From c94bd63374a9454450799219ae84090927c0ef71 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 5 Dec 2023 15:31:32 +0100 Subject: [PATCH] Fix scripts --- packages/server/src/appMigrations/migrations.ts | 2 +- scripts/add-app-migration.js | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/packages/server/src/appMigrations/migrations.ts b/packages/server/src/appMigrations/migrations.ts index 02b93a781b..d66e2e8895 100644 --- a/packages/server/src/appMigrations/migrations.ts +++ b/packages/server/src/appMigrations/migrations.ts @@ -3,5 +3,5 @@ import { AppMigration } from "." export const MIGRATIONS: AppMigration[] = [ - // Migrations will be executed sorted by migrationId + // Migrations will be executed sorted by id ] diff --git a/scripts/add-app-migration.js b/scripts/add-app-migration.js index 78f71eca93..a58d3a4fbe 100644 --- a/scripts/add-app-migration.js +++ b/scripts/add-app-migration.js @@ -51,22 +51,19 @@ export default migration .map(m => m.substring(0, m.length - 3)) let migrationFileContent = - "// This file should never be manually modified, use `yarn add-app-migration` in order to add a new one\n\n" + '// This file should never be manually modified, use `yarn add-app-migration` in order to add a new one\n\nimport { AppMigration } from "."\n\n' for (const migration of migrations) { migrationFileContent += `import m${migration} from "./migrations/${migration}"\n` } - migrationFileContent += `\nexport const MIGRATIONS: { - migrationId: string - migrationFunc: () => Promise -}[] = [ - // Migrations will be executed sorted by migrationId\n` + migrationFileContent += `\nexport const MIGRATIONS: AppMigration[] = [ + // Migrations will be executed sorted by id\n` for (const migration of migrations) { migrationFileContent += ` { - migrationId: "${migration}", - migrationFunc: m${migration} + id: "${migration}", + func: m${migration} },\n` }