fix: Migration script check, closes #7479

This commit is contained in:
Tom Moor committed 2024-09-02 22:39:05 -04:00
1 parent bb074fc8cf
commit 29fdd7e566
1 file changed
+8 -3
+8 -3
View File
@@ -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: