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.0.1 to 0.0.2

3

config/sequelize.js
exports.default = {
sequelize: function(api){
return {
"logging" : true,
"database" : "DEVELOPMENT_DB",

@@ -11,3 +10,2 @@ "dialect" : "mysql",

"password" : "",
}
}

@@ -17,2 +15,3 @@ }

exports.test = {

@@ -19,0 +18,0 @@ sequelize: function(api){

var path = require('path');
var fs = require('fs');
var Sequelize = require('sequelize');
var SequelizeFixtures = require('sequelize-fixtures');

@@ -14,3 +13,8 @@ exports.sequelize = function(api, next){

api.sequelize.sequelize = new Sequelize(api.config.sequelize.database, null, null, api.config.sequelize);
api.sequelize.sequelize = new Sequelize(
api.config.sequelize.database,
api.config.sequelize.username,
api.config.sequelize.password,
api.config.sequelize
);

@@ -25,2 +29,4 @@ var dir = path.normalize(api.project_root + '/models');

if(api.env === "test"){
var SequelizeFixtures = require('sequelize-fixtures');
SequelizeFixtures.loadFile(api.project_root + '/test/fixtures/*.json', api.models, function(){

@@ -41,3 +47,3 @@ SequelizeFixtures.loadFile(api.project_root + '/test/fixtures/*.yml', api.models, function(){

migrate: function(next){
var migrator = sequelize.getMigrator({
var migrator = api.sequelize.sequelize.getMigrator({
path: api.project_root + '/migrations',

@@ -51,5 +57,12 @@ });

test: function(next){
// stub for more test setup
next();
}
// ensure the connection with a test
api.sequelize.sequelize.query("SELECT NOW()").success(function(){
next()
}).failure(function(err){
api.log(err, 'warning');
console.log(err);
process.exit();
});
},
}

@@ -56,0 +69,0 @@

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

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

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

@@ -14,2 +14,15 @@ ah-sequelize-plugin

## Models
Use the exports form of sequelize models in `./models` with the file name matching that of the model, IE:
```javascript
module.exports = function(sequelize, DataTypes) {
return sequelize.define("Project", {
name: DataTypes.STRING,
description: DataTypes.TEXT
})
}
```
## [Migrations](http://sequelizejs.com/docs/latest/migrations)

@@ -16,0 +29,0 @@

@@ -16,3 +16,3 @@ #!/usr/bin/env node

['models', 'test/fixtures'].forEach(function(f){
mkdirp.sync(path.normalize(process.cwd() + '/' + f));
mkdirp.sync(path.normalize(process.cwd() + '/../../' + f));
});
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