Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ah-sequelize-plugin

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ah-sequelize-plugin - npm Package Compare versions

Comparing version 0.5.1 to 0.6.0

2

config/sequelize.js

@@ -5,2 +5,3 @@ exports.default = {

"autoMigrate" : true,
"loadFixtures": false,
"database" : "DEVELOPMENT_DB",

@@ -38,2 +39,3 @@ "dialect" : "mysql",

// "autoMigrate" : false,
// "loadFixtures": false,
// "logging" : false,

@@ -40,0 +42,0 @@ // "database" : "PRODUCTION_DB",

36

initializers/sequelize.js

@@ -46,11 +46,23 @@ var path = require('path');

if(api.env === "test"){
var SequelizeFixtures = require('sequelize-fixtures');
SequelizeFixtures.loadFile(api.projectRoot + '/test/fixtures/*.json', api.models, function(){
SequelizeFixtures.loadFile(api.projectRoot + '/test/fixtures/*.yml', api.models, function(){
api.sequelize.test(next);
api.sequelize.test(next);
},
loadFixtures: function(next) {
if(api.config.sequelize.loadFixtures) {
var SequelizeFixtures = require('sequelize-fixtures');
SequelizeFixtures.loadFile(api.projectRoot + '/test/fixtures/*.{json,yml,js}', api.models, function () {
next();
});
});
}else{
api.sequelize.test(next);
} else {
next();
}
},
autoMigrate: function(next) {
if(api.config.sequelize.autoMigrate == null || api.config.sequelize.autoMigrate) {
api.sequelize.migrate({method: 'up'}, function () {
next();
});
} else {
next();
}

@@ -85,9 +97,7 @@ },

if(api.config.sequelize.autoMigrate) {
api.sequelize.migrate({method: 'up'}, next)
} else {
next(err);
}
api.sequelize.autoMigrate(function() {
api.sequelize.loadFixtures(next);
});
});
}
};

@@ -5,3 +5,3 @@ {

"description": "I use sequelize in actionhero as an ORM",
"version": "0.5.1",
"version": "0.6.0",
"homepage": "http://actionherojs.com",

@@ -8,0 +8,0 @@ "repository": {

@@ -127,2 +127,4 @@ # ah-sequelize-plugin

We use the `sequelize-fixtures` package to load in JSON-defined fixtures in the test NODE\_ENV. Store your fixtures in `./test/fixtures/*.json` or `./test/fixtures/*.yml`
We use the `sequelize-fixtures` package to load in JSON-defined fixtures in the test NODE\_ENV. Store your fixtures in `./test/fixtures/*.json` or `./test/fixtures/*.yml`.
By default, `ah-sequelize-plugin` will **not** automatically load your fixtures when Actionhero starts up. You can enable this behaviour by adding `loadFixtures: true` to your sequelize config.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc