From 678339c5c9387b16759dc9abc835b6345b5cef4f Mon Sep 17 00:00:00 2001 From: Troplo Date: Fri, 29 Jul 2022 23:34:35 +1000 Subject: [PATCH] Update index.js --- cli/index.js | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/cli/index.js b/cli/index.js index 571df05..a56b903 100644 --- a/cli/index.js +++ b/cli/index.js @@ -139,21 +139,9 @@ async function dbSetup() { } async function runMigrations() { console.log("Running migrations") - const config = require("../backend/config/config.json").production - const sequelize = new Sequelize(config) - - const umzug = new Umzug({ - migrations: { glob: "../backend/migrations/*.js" }, - context: sequelize.getQueryInterface(), - storage: new SequelizeStorage({ sequelize }), - logger: console, - logging: true + execSync("cd ../backend && sequelize db:migrate", () => { + console.log("Migrations applied") }) - - await (async () => { - await umzug.up() - })() - console.log("Migrations applied") } async function createUser() { const user = {