fix(server): ensure selfhost admin created after all data migrated (#6163)

fix #6154 

cp to canary
This commit is contained in:
liuyi
2024-03-18 11:40:14 +08:00
committed by LongYinan
parent 58c81dd1ac
commit 268ca03f62
2 changed files with 3 additions and 1 deletions

View File

@@ -23,6 +23,8 @@ export async function collectMigrations(): Promise<Migration[]> {
)
.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 => {

View File

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