Fix scripts
This commit is contained in:
parent
a8070829c9
commit
c94bd63374
|
@ -3,5 +3,5 @@
|
||||||
import { AppMigration } from "."
|
import { AppMigration } from "."
|
||||||
|
|
||||||
export const MIGRATIONS: AppMigration[] = [
|
export const MIGRATIONS: AppMigration[] = [
|
||||||
// Migrations will be executed sorted by migrationId
|
// Migrations will be executed sorted by id
|
||||||
]
|
]
|
||||||
|
|
|
@ -51,22 +51,19 @@ export default migration
|
||||||
.map(m => m.substring(0, m.length - 3))
|
.map(m => m.substring(0, m.length - 3))
|
||||||
|
|
||||||
let migrationFileContent =
|
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) {
|
for (const migration of migrations) {
|
||||||
migrationFileContent += `import m${migration} from "./migrations/${migration}"\n`
|
migrationFileContent += `import m${migration} from "./migrations/${migration}"\n`
|
||||||
}
|
}
|
||||||
|
|
||||||
migrationFileContent += `\nexport const MIGRATIONS: {
|
migrationFileContent += `\nexport const MIGRATIONS: AppMigration[] = [
|
||||||
migrationId: string
|
// Migrations will be executed sorted by id\n`
|
||||||
migrationFunc: () => Promise<void>
|
|
||||||
}[] = [
|
|
||||||
// Migrations will be executed sorted by migrationId\n`
|
|
||||||
|
|
||||||
for (const migration of migrations) {
|
for (const migration of migrations) {
|
||||||
migrationFileContent += ` {
|
migrationFileContent += ` {
|
||||||
migrationId: "${migration}",
|
id: "${migration}",
|
||||||
migrationFunc: m${migration}
|
func: m${migration}
|
||||||
},\n`
|
},\n`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue