1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-06 10:52:31 +01:00
server/scripts/stagingMigration/index.js

23 lines
472 B
JavaScript
Raw Normal View History

const { DataSourceOptions, DatabaseType, initDatabase } = require("../..");
const path = require("path");
(async () => {
DataSourceOptions.setOptions({
logging: true,
2023-01-05 07:12:21 +01:00
migrations: [
path.join(
process.cwd(),
"scripts",
"stagingMigration",
DatabaseType,
"*.js",
),
],
});
const dbConnection = await DataSourceOptions.initialize();
await dbConnection.runMigrations();
await dbConnection.destroy();
console.log("migration done");
2023-01-05 07:12:21 +01:00
})();