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

grunt-fluentmigrator

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-fluentmigrator - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

utils.js

2

package.json
{
"name": "grunt-fluentmigrator",
"version": "0.1.1",
"version": "0.1.2",
"description": "Fluent Migrator wrapper",

@@ -5,0 +5,0 @@ "main": "Gruntfile.js",

### Overview
Here is simple Migrate.exe wrapper. Provide path to executable(relative to project directory) and command-line parameters which will be passed directly to executable(you can list all parameters by typing Migrate.exe -h)
```js

@@ -7,9 +9,36 @@ grunt.initConfig({

exePath: 'tools/migrator/Migrate.exe',
assembly : 'src/SomeProject.Migrations/bin/Debug/SomeProject.Migrations.dll',
output: true,
outputFileName: 'migrated.sql',
conn: config['DB_CONNECTION_STRING']
params: {
assembly : 'src/SomeProject.Migrations/bin/Debug/SomeProject.Migrations.dll',
output: true,
outputFileName: 'migrated.sql',
conn: "Server=.;initial catalog=SiteDb;Integrated Security=true;"
}
}
},
}
})
```
### Defaults
This default options will be merged with task-defined
```js
{
exePath: 'Migrate.exe',
params: {
provider: 'sqlserver2012',
preview: true,
task: 'migrate'
}
}
```
### Change log
0.1.2 (June 9, 2014)
* Support all command-line parameters
* fixed bug with output file name and directory
0.1.1 (May 29, 2014)
* Initial version
var spawn = require('child_process').spawn,
defaults = {
exePath: 'Migrate.exe',
provider: 'sqlserver2012',
preview: true,
task: 'migrate'
},
buildCommandParameters = function(options) {
var allParams = ['conn', 'provider', 'assembly', 'task', 'output', 'outputFilename', 'preview'],
params = [];
extend = require('./../utils').extend,
buildCommandParameters = require('./../utils').buildCommandParameters;
allParams.forEach(function(param) {
var val = options[param];
if (val !== undefined) {
if (typeof val == 'boolean') {
val && params.push('--' + param);
} else {
params.push('--' + param);
params.push(val)
}
}
});
return params;
};
module.exports = function(grunt) {
grunt.registerTask('fluentmigrator', 'Migration starting', function() {
var options = this.options(defaults),
var options = extend({
exePath: 'Migrate.exe',
params: {
provider: 'sqlserver2012',
preview: true,
task: 'migrate'
}
}, this.options()),
done = this.async(),
log = function(message) { console.log(message.toString('utf8')); },
migrate = spawn(options.exePath, buildCommandParameters(options));
log = function(message) {
console.log(message.toString('utf8'));
},
migrate = spawn(options.exePath, buildCommandParameters(options.params));

@@ -34,0 +21,0 @@ migrate.stdout.on('data', log);

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