fix: initial start of the app fails due to missing migrations in the main db

This commit is contained in:
Gergő Jedlicska
2024-02-12 10:44:42 +01:00
parent dc0108fa9c
commit 1e885590cb
+4 -3
View File
@@ -30,11 +30,12 @@ const migrateToLatest = async (client: Knex): Promise<void> => {
};
export const migrateAll = async (): Promise<void> => {
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