diff options
Diffstat (limited to 'scripts/stagingMigration/index.js')
-rw-r--r-- | scripts/stagingMigration/index.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/stagingMigration/index.js b/scripts/stagingMigration/index.js new file mode 100644 index 00000000..bc375b49 --- /dev/null +++ b/scripts/stagingMigration/index.js @@ -0,0 +1,14 @@ +const { DataSourceOptions, DatabaseType, initDatabase } = require("../.."); +const path = require("path"); + +(async () => { + DataSourceOptions.setOptions({ + logging: true, + migrations: [path.join(process.cwd(), "scripts", "stagingMigration", DatabaseType, "*.js")] + }); + + const dbConnection = await DataSourceOptions.initialize(); + await dbConnection.runMigrations(); + await dbConnection.destroy(); + console.log("migration done"); +})(); \ No newline at end of file |