summary refs log tree commit diff
path: root/scripts/syncronise.js
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/syncronise.js')
-rw-r--r--scripts/syncronise.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/syncronise.js b/scripts/syncronise.js
new file mode 100644
index 00000000..6ce47278
--- /dev/null
+++ b/scripts/syncronise.js
@@ -0,0 +1,19 @@
+/*
+	"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");
+})();
\ No newline at end of file