mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-06 10:52:31 +01:00
e42eaeee8d
* Fix typeorm migration cli and server migrations. * Add `migrate-from-staging` script
14 lines
436 B
JavaScript
14 lines
436 B
JavaScript
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");
|
|
})(); |