1
0
Fork 0
mirror of synced 2024-06-18 18:35:37 +12:00

Fix scripts

This commit is contained in:
Adria Navarro 2023-12-05 15:31:32 +01:00
parent a8070829c9
commit c94bd63374
2 changed files with 6 additions and 9 deletions

View file

@ -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
]

View file

@ -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<void>
}[] = [
// 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`
}