summary refs log tree commit diff
path: root/scripts/syncronise.js
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-12-18 21:54:20 +1100
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-12-18 22:14:12 +1100
commit32e9d1828cf9ce55b5179fe9338b82154b5bfeba (patch)
tree3670e773630724aa48ed4fe2d4c4604454e07071 /scripts/syncronise.js
parentRefactored testclient (diff)
downloadserver-32e9d1828cf9ce55b5179fe9338b82154b5bfeba.tar.xz
Move to migrations. Use `npm run generate:db` for first database generation.
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