diff --git a/packages/backend/server/src/data/commands/run.ts b/packages/backend/server/src/data/commands/run.ts index 7d4df391f57df..33b4482b02c15 100644 --- a/packages/backend/server/src/data/commands/run.ts +++ b/packages/backend/server/src/data/commands/run.ts @@ -23,6 +23,8 @@ export async function collectMigrations(): Promise { ) .map(desc => join(folder, desc)); + migrationFiles.sort((a, b) => a.localeCompare(b)); + const migrations: Migration[] = await Promise.all( migrationFiles.map(async file => { return import(pathToFileURL(file).href).then(mod => { diff --git a/packages/backend/server/src/data/migrations/1605053000403-self-host-admin.ts b/packages/backend/server/src/data/migrations/99999999-self-host-admin.ts similarity index 96% rename from packages/backend/server/src/data/migrations/1605053000403-self-host-admin.ts rename to packages/backend/server/src/data/migrations/99999999-self-host-admin.ts index 0d13b0724d831..11c791f2fd880 100644 --- a/packages/backend/server/src/data/migrations/1605053000403-self-host-admin.ts +++ b/packages/backend/server/src/data/migrations/99999999-self-host-admin.ts @@ -4,7 +4,7 @@ import { PrismaClient } from '@prisma/client'; import { UserService } from '../../core/user'; import { Config, CryptoHelper } from '../../fundamentals'; -export class SelfHostAdmin1605053000403 { +export class SelfHostAdmin99999999 { // do the migration static async up(_db: PrismaClient, ref: ModuleRef) { const config = ref.get(Config, { strict: false });