Handle no migrations

This commit is contained in:
Adria Navarro 2024-01-08 12:15:12 +01:00
parent 9ebe93f71d
commit f77b812679
1 changed files with 7 additions and 2 deletions

View File

@ -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
}