generated from bastian/boilerplate
Initial commit
This commit is contained in:
13
apps/backend/src/database/run-migrations.ts
Normal file
13
apps/backend/src/database/run-migrations.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import 'reflect-metadata';
|
||||
import dataSource from './typeorm-cli.datasource';
|
||||
|
||||
async function run(): Promise<void> {
|
||||
await dataSource.initialize();
|
||||
try {
|
||||
await dataSource.runMigrations({ transaction: 'all' });
|
||||
} finally {
|
||||
await dataSource.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
void run();
|
||||
Reference in New Issue
Block a user