diff --git a/packages/server/src/api/controllers/static/index.ts b/packages/server/src/api/controllers/static/index.ts index 0166f92478..5f383e837d 100644 --- a/packages/server/src/api/controllers/static/index.ts +++ b/packages/server/src/api/controllers/static/index.ts @@ -135,9 +135,14 @@ const requiresMigration = async (ctx: Ctx) => { ctx.throw("AppId could not be found") } - const latestAppliedMigration = await getAppMigrationVersion(appId) + const latestMigration = getLatestMigrationId() + if (!latestMigration) { + return false + } - const requiresMigrations = latestAppliedMigration !== getLatestMigrationId() + const latestMigrationApplied = await getAppMigrationVersion(appId) + + const requiresMigrations = latestMigrationApplied !== latestMigration return requiresMigrations }