Move to migrations. Use npm run generate:db for first database generation.

This commit is contained in:
Madeline
2022-12-18 21:54:20 +11:00
parent ed6aecf157
commit 32e9d1828c
5 changed files with 22 additions and 8 deletions
+19
View File
@@ -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");
})();