hedgeagent/1.12.0 #1

Open
sa6anw wants to merge 201 commits from hedgeagent/1.12.0 into hedgeagent/1.10.5
Showing only changes of commit 788676aba4 - Show all commits

View File

@@ -4,7 +4,7 @@ const fs = require('fs')
const path = require('path')
const Sequelize = require('sequelize')
const { cloneDeep } = require('lodash')
const Umzug = require('umzug')
const { SequelizeStorage, Umzug } = require('umzug')
// core
const config = require('../config')
@@ -66,21 +66,24 @@ Object.keys(db).forEach(function (modelName) {
const umzug = new Umzug({
migrations: {
path: path.resolve(__dirname, '..', 'migrations'),
params: [
sequelize.getQueryInterface(),
Sequelize.DataTypes
]
glob: path.resolve(__dirname, '..', 'migrations', '*.js'),
resolve: ({ name, path, context }) => {
// Adjust the migration from the new signature to the v2 signature, making easier to upgrade to v3
const migration = require(path)
return {
name,
up: async () => migration.up(context, Sequelize),
down: async () => migration.down(context, Sequelize)
}
}
},
context: sequelize.getQueryInterface(),
// Required wrapper function required to prevent winstion issue
// https://github.com/winstonjs/winston/issues/1577
logging: message => {
logger.info(message)
},
storage: 'sequelize',
storageOptions: {
sequelize
}
storage: new SequelizeStorage({ sequelize })
})
db.runMigrations = async function runMigrations () {