From 29fdd7e56618c3d978336eaebf05784b7b77d7ad Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Mon, 2 Sep 2024 22:39:05 -0400 Subject: [PATCH] fix: Migration script check, closes #7479 --- server/utils/startup.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/server/utils/startup.ts b/server/utils/startup.ts index 39bf8ec58d..e249a6f399 100644 --- a/server/utils/startup.ts +++ b/server/utils/startup.ts @@ -43,10 +43,15 @@ export async function checkDataMigrations() { return; } - const teams = await Team.count(); - const providers = await AuthenticationProvider.count(); + const team = await Team.findOne(); + const provider = await AuthenticationProvider.findOne(); - if (env.isProduction && teams && !providers) { + if ( + env.isProduction && + team && + team.createdAt < new Date("2024-01-01") && + !provider + ) { Logger.warn(` This version of Outline cannot start until a data migration is complete. Backup your database, run the database migrations and the following script: