summary refs log tree commit diff
path: root/scripts/stagingMigration/index.js
blob: a1acaabb57222a555a74d04bb0b47bae4973ac4f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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");
})();