summary refs log tree commit diff
path: root/scripts/syncronise.js
blob: 3889566299c26befcc36ee8eee7b9c558ce51877 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
	"Why?" I hear you say! "Why don't you just use `typeorm schema:sync`?"!
	Because we have a lot ( like, 30? ) cyclic imports in the entities folder,
	which breaks that command entirely!

	however!
	it doesn't break the below, thus we're left with this :sob:
*/

require("module-alias/register");
require("dotenv").config();
const { initDatabase } = require("..");

(async () => {
	const db = await initDatabase();
	console.log("synchronising");
	await db.synchronize();
	console.log("done");
	db.destroy();
})();