diff --git a/packages/backend/src/db/migrations/20240507135944_mark_userful_instances_installation_completed.js b/packages/backend/src/db/migrations/20240507135944_mark_userful_instances_installation_completed.js new file mode 100644 index 00000000..0ffbfd6d --- /dev/null +++ b/packages/backend/src/db/migrations/20240507135944_mark_userful_instances_installation_completed.js @@ -0,0 +1,17 @@ +export async function up(knex) { + const users = await knex('users').limit(1); + + // no user implies installation is not completed yet. + if (users.length === 0) return; + + await knex('config').insert({ + key: 'installation.completed', + value: { + data: true + } + }); +}; + +export async function down(knex) { + await knex('config').where({ key: 'installation.completed' }).delete(); +};