async function up(knex) {
    const rows = await knex("settings").select("id", "apikey", "settings_json");
    for (const row of rows) {
        if (!row.apikey)
            continue;
        const settings = row.settings_json == null ? {} : JSON.parse(row.settings_json);
        if (typeof settings.apiKey === "string" && settings.apiKey.length > 0) {
            continue;
        }
        await knex("settings")
            .where({ id: row.id })
            .update({
            settings_json: JSON.stringify({
                ...settings,
                apiKey: row.apikey,
            }),
        });
    }
}
async function down() { }
export default { name: "17-api-key-settings-json", up, down };
//# sourceMappingURL=17-api-key-settings-json.js.map