ah-sequelize-plugin
Advanced tools
Comparing version 0.4.1 to 0.4.2
@@ -5,3 +5,3 @@ { | ||
"description": "I use sequelize in actionhero as an ORM", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"homepage": "http://actionherojs.com", | ||
@@ -8,0 +8,0 @@ "repository": { |
@@ -16,3 +16,3 @@ # ah-sequelize-plugin | ||
## [Models](http://sequelizejs.com/docs/latest/models) | ||
## [Models](http://docs.sequelizejs.com/en/latest/api/models) | ||
@@ -32,3 +32,3 @@ Use the exports form of sequelize models in `./models` with the file name matching that of the model, IE: | ||
## [Migrations](http://sequelizejs.com/docs/latest/migrations) | ||
## [Migrations](http://docs.sequelizejs.com/en/latest/api/migrations) | ||
@@ -87,3 +87,3 @@ This pluggin does not condone the use of `Sequelize.sync()` in favor of migrations. Keep you migrations in `./migrationss` and run `api.sequelize.migrate()`. | ||
You can use the [sequelize-cli](http://sequelizejs.com/docs/latest/migrations#cli) for more utilities or | ||
You can use the [sequelize-cli](http://docs.sequelizejs.com/en/latest/api/migrations#cli) for more utilities or | ||
you can add a migration grunt helper(s) to your actionhero project by adding the below to your `gruntfile.js`: | ||
@@ -117,3 +117,3 @@ | ||
## [Associations](http://sequelizejs.com/docs/latest/associations) | ||
## [Associations](http://docs.sequelizejs.com/en/latest/api/associations) | ||
@@ -120,0 +120,0 @@ If you want to declare associations, best practice has you create an `associations` initializer within your project which might look like this: |
@@ -7,15 +7,25 @@ #!/usr/bin/env node | ||
var localFile = path.normalize(__dirname + '/../config/sequelize.js'); | ||
var projectFile = path.normalize(process.cwd() + '/../../config/sequelize.js'); | ||
var localConfigFile = path.normalize(__dirname + '/../config/sequelize.js'); | ||
var projectConfigFile = path.normalize(process.cwd() + '/../../config/sequelize.js'); | ||
var localRcFile = path.normalize(__dirname + '/../config/.sequelizerc'); | ||
var projectRcFile = path.normalize(process.cwd() + '/../../.sequelizerc'); | ||
try { | ||
fs.lstatSync(projectFile); | ||
fs.lstatSync(projectConfigFile); | ||
} catch (ex) { | ||
//unable to stat file because it doesn't exist | ||
console.log("coppying " + localFile + " to " + projectFile) | ||
fs.createReadStream(localFile).pipe(fs.createWriteStream(projectFile)); | ||
console.log("copying " + localConfigFile + " to " + projectConfigFile); | ||
fs.createReadStream(localConfigFile).pipe(fs.createWriteStream(projectConfigFile)); | ||
} | ||
try { | ||
fs.lstatSync(projectRcFile); | ||
} catch (ex) { | ||
console.log("copying " + localRcFile + " to " + projectRcFile + " for "); | ||
fs.createReadStream(localRcFile).pipe(fs.createWriteStream(projectRcFile)); | ||
} | ||
['models', 'test/fixtures'].forEach(function(f){ | ||
mkdirp.sync(path.normalize(process.cwd() + '/../../' + f)); | ||
}); |
9722
7
136