fix(product): The bin scripts should include a shebang and import in the body (#4296)

This commit is contained in:
Adrien de Peretti
2023-06-15 19:42:49 +02:00
committed by GitHub
parent 1d91fa4e08
commit 30d89044f1
11 changed files with 82 additions and 124 deletions
+9 -3
View File
@@ -33,11 +33,17 @@ export async function runMigrations({
try {
const migrator = orm.getMigrator()
await migrator.up()
logger?.info("Product module migration executed")
const pendingMigrations = await migrator.getPendingMigrations()
logger.info("Running pending migrations:", pendingMigrations)
await migrator.up({
migrations: pendingMigrations.map((m) => m.name),
})
logger.info("Product module migration executed")
} catch (error) {
logger?.error(`Product module migration failed to run - Error: ${error}`)
logger.error(`Product module migration failed to run - Error: ${error}`)
}
await orm.close()