Update index.js

This commit is contained in:
Troplo 2022-07-29 23:34:35 +10:00
parent 344dd11bed
commit 678339c5c9

View file

@ -139,21 +139,9 @@ async function dbSetup() {
} }
async function runMigrations() { async function runMigrations() {
console.log("Running migrations") console.log("Running migrations")
const config = require("../backend/config/config.json").production execSync("cd ../backend && sequelize db:migrate", () => {
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
})
await (async () => {
await umzug.up()
})()
console.log("Migrations applied") console.log("Migrations applied")
})
} }
async function createUser() { async function createUser() {
const user = { const user = {