mirror of
https://github.com/Troplo/Colubrina.git
synced 2024-11-22 19:27:55 +11:00
Update index.js
This commit is contained in:
parent
344dd11bed
commit
678339c5c9
1 changed files with 2 additions and 14 deletions
16
cli/index.js
16
cli/index.js
|
@ -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)
|
console.log("Migrations applied")
|
||||||
|
|
||||||
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")
|
|
||||||
}
|
}
|
||||||
async function createUser() {
|
async function createUser() {
|
||||||
const user = {
|
const user = {
|
||||||
|
|
Loading…
Reference in a new issue