diff --git a/backend/src/db/migrations/20240226094411_instance-id.ts b/backend/src/db/migrations/20240226094411_instance-id.ts index ae88bb3fd..0b87ffe57 100644 --- a/backend/src/db/migrations/20240226094411_instance-id.ts +++ b/backend/src/db/migrations/20240226094411_instance-id.ts @@ -11,7 +11,11 @@ export async function up(knex: Knex): Promise { // this is updated to avoid race condition on replication // eslint-disable-next-line // @ts-ignore - await knex(TableName.SuperAdmin).update({ id: ADMIN_CONFIG_UUID }).whereNotNull("id").limit(1); + await knex(TableName.SuperAdmin) + .update({ id: ADMIN_CONFIG_UUID }) + .whereNotNull("id") + .andWhere("id", "<>", ADMIN_CONFIG_UUID) + .limit(1); } export async function down(knex: Knex): Promise {