clever-orm
Advanced tools
Comparing version 0.0.13 to 0.0.14
var fs = require( 'fs' ) | ||
, utils = require( 'utils' ) | ||
, env = utils.bootstrapEnv(); // Bootstrap the environment | ||
, env = utils.bootstrapEnv() // Bootstrap the environment | ||
, moduleName = process.argv && process.argv[ 2 ] != 'null' | ||
? process.argv[ 2 ] | ||
: false; | ||
@@ -8,7 +11,12 @@ console.log('Forcing Database to be created! (Note: All your data will disapear!)'); | ||
// Load all the modules | ||
env.moduleLoader.loadModules(); | ||
if ( moduleName ) { | ||
env.moduleLoader.loadModule( 'clever-orm', env ); | ||
env.moduleLoader.loadModule( moduleName, env ); | ||
} else { | ||
env.moduleLoader.loadModules( env ); | ||
} | ||
// Force a sync | ||
injector.getInstance( 'sequelize' ) | ||
.sync() | ||
.sync( { force: true } ) | ||
.success(function () { | ||
@@ -15,0 +23,0 @@ console.log( 'Database is rebased' ); |
@@ -6,3 +6,6 @@ var fs = require( 'fs' ) | ||
, async = require( 'async' ) | ||
, inflect = require( 'i' )(); | ||
, inflect = require( 'i' )() | ||
, moduleName = process.argv && process.argv[ 2 ] != 'null' | ||
? process.argv[ 2 ] | ||
: false; | ||
@@ -14,3 +17,8 @@ // Bootstrap the environment, but don't initializeModuleRoutes( injector ) | ||
// Load all the modules | ||
env.moduleLoader.loadModules(); | ||
if ( moduleName ) { | ||
env.moduleLoader.loadModule( 'clever-orm', env ); | ||
env.moduleLoader.loadModule( moduleName, env ); | ||
} else { | ||
env.moduleLoader.loadModules( env ); | ||
} | ||
@@ -17,0 +25,0 @@ // Load the seedData and get the models |
@@ -0,0 +0,0 @@ { |
@@ -7,2 +7,5 @@ 'use strict'; | ||
module.exports = function( grunt ) { | ||
// Arguments for individual module rebase/seed | ||
var dbTarget = grunt.option( 'module' ) || null; | ||
return [{ | ||
@@ -60,6 +63,6 @@ prompt: { | ||
rebase: { | ||
cmd: "NODE_PATH=./lib/:./modules/; node modules/clever-orm/bin/rebase.js" | ||
cmd: "NODE_PATH=./lib/:./modules/; node modules/clever-orm/bin/rebase.js " + dbTarget | ||
}, | ||
seed: { | ||
cmd: "NODE_PATH=./lib/:./modules/; node modules/clever-orm/bin/seedModels.js" | ||
cmd: "NODE_PATH=./lib/:./modules/; node modules/clever-orm/bin/seedModels.js " + dbTarget | ||
} | ||
@@ -66,0 +69,0 @@ } |
@@ -0,0 +0,0 @@ var Sequelize = require( 'sequelize' ) |
{ | ||
"name": "clever-orm", | ||
"version": "0.0.13", | ||
"version": "0.0.14", | ||
"dependencies": { | ||
@@ -5,0 +5,0 @@ "mysql": "2.0.0-rc2", |
@@ -0,0 +0,0 @@ # Cleverstack ORM module |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
15012
297
1