From fe50800613611f6552740cbd68e3b0db56690d3e Mon Sep 17 00:00:00 2001 From: Madeline <46743919+MaddyUnderStars@users.noreply.github.com> Date: Sun, 18 Dec 2022 21:54:20 +1100 Subject: Move to migrations. Use `npm run generate:db` for first database generation. --- scripts/syncronise.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 scripts/syncronise.js (limited to 'scripts/syncronise.js') 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 -- cgit 1.4.1