ah-sequelize-plugin
Advanced tools
Comparing version 0.3.2 to 0.4.0
@@ -33,5 +33,5 @@ var path = require('path'); | ||
api.sequelize.sequelize = new Sequelize( | ||
api.config.sequelize.database, | ||
api.config.sequelize.username, | ||
api.config.sequelize.password, | ||
api.config.sequelize.database, | ||
api.config.sequelize.username, | ||
api.config.sequelize.password, | ||
api.config.sequelize | ||
@@ -46,4 +46,4 @@ ); | ||
}); | ||
if(api.env === "test"){ | ||
if(api.env === "test"){ | ||
var SequelizeFixtures = require('sequelize-fixtures'); | ||
@@ -60,2 +60,7 @@ SequelizeFixtures.loadFile(api.projectRoot + '/test/fixtures/*.json', api.models, function(){ | ||
// api.sequelize.test([exitOnError=true], next); | ||
// Checks to see if mysql can be reached by selecting the current time | ||
// Arguments: | ||
// - next (callback function(err)): Will be called after the test is complete | ||
// If the test fails, the `err` argument will contain the error | ||
test: function(next){ | ||
@@ -67,3 +72,3 @@ api.sequelize.sequelize.query("SELECT NOW()").then(function(){ | ||
console.log(err); | ||
process.exit(); | ||
next(err); | ||
}); | ||
@@ -79,6 +84,6 @@ }, | ||
start: function(api, next){ | ||
api.sequelize.connect(function(){ | ||
next(); | ||
api.sequelize.connect(function(err){ | ||
next(err); | ||
}); | ||
} | ||
}; |
@@ -5,3 +5,3 @@ { | ||
"description": "I use sequelize in actionhero as an ORM", | ||
"version": "0.3.2", | ||
"version": "0.4.0", | ||
"homepage": "http://actionherojs.com", | ||
@@ -8,0 +8,0 @@ "repository": { |
@@ -10,3 +10,6 @@ #!/usr/bin/env node | ||
if(!fs.existsSync(projectFile)){ | ||
try { | ||
fs.lstatSync(projectFile); | ||
} catch (ex) { | ||
//unable to stat file because it doesn't exist | ||
console.log("coppying " + localFile + " to " + projectFile) | ||
@@ -18,2 +21,2 @@ fs.createReadStream(localFile).pipe(fs.createWriteStream(projectFile)); | ||
mkdirp.sync(path.normalize(process.cwd() + '/../../' + f)); | ||
}); | ||
}); |
9071
138