ah-sequelize-plugin
Advanced tools
Comparing version 0.8.5 to 0.8.6
@@ -7,9 +7,9 @@ var path = require('path'); | ||
module.exports = { | ||
loadPriority: 101, // aligned with actionhero's redis initializer | ||
startPriority: 101, // aligned with actionhero's redis initializer | ||
stopPriority: 101, // aligned with actionhero's redis initializer | ||
loadPriority: 121, // aligned with actionhero's redis and logger initializer | ||
startPriority: 121, // aligned with actionhero's redis and logger initializer | ||
stopPriority: 121, // aligned with actionhero's redis and logger initializer | ||
initialize: function(api, next){ | ||
api.models = {}; | ||
api.config.sequelize.logging = api.logger.info; | ||
var sequelizeInstance = new Sequelize( | ||
@@ -31,3 +31,4 @@ api.config.sequelize.database, | ||
}], | ||
path: api.projectRoot + '/migrations' | ||
path: api.projectRoot + '/migrations', | ||
pattern: /\.js$/ | ||
} | ||
@@ -92,3 +93,5 @@ }); | ||
autoMigrate: function(next) { | ||
if(api.config.sequelize.autoMigrate === null || api.config.sequelize.autoMigrate) { | ||
if(api.config.sequelize.autoMigrate === null || | ||
api.config.sequelize.autoMigrate === undefined || | ||
api.config.sequelize.autoMigrate) { | ||
checkMetaOldSchema(api, umzug).then(function() { | ||
@@ -141,3 +144,3 @@ return umzug.up(); | ||
// Check if we need to upgrade from the old sequelize migration format | ||
return api.sequelize.sequelize.query('SELECT * FROM "SequelizeMeta"', {raw: true}).then(function(raw) { | ||
return api.sequelize.sequelize.query('SELECT * FROM SequelizeMeta', {raw: true}).then(function(raw) { | ||
var rows = raw[0]; | ||
@@ -144,0 +147,0 @@ if (rows.length && rows[0].hasOwnProperty('id')) { |
@@ -5,3 +5,3 @@ { | ||
"description": "I use sequelize in actionhero as an ORM", | ||
"version": "0.8.5", | ||
"version": "0.8.6", | ||
"homepage": "http://actionherojs.com", | ||
@@ -8,0 +8,0 @@ "repository": { |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
14498
221
1