diff --git a/src/services/databaseManagement.ts b/src/services/databaseManagement.ts index 2ad2dbe..598ac62 100644 --- a/src/services/databaseManagement.ts +++ b/src/services/databaseManagement.ts @@ -30,11 +30,12 @@ const migrateToLatest = async (client: Knex): Promise => { }; export const migrateAll = async (): Promise => { + await migrateToLatest(mainClient); const databaseSchemas = await getAllDatabaseSchemaConnections(); - await Promise.all( - databaseSchemas.map(async (sc) => await migrateToLatest(sc)), - ); + await Promise.all([ + ...databaseSchemas.map(async (sc) => await migrateToLatest(sc)), + ]); // 1. get all regions from main DB // 2. construct region specific knex clients and cache them by // 3. structure the cache so that it accomodates client creation by resource id