Comparing version 0.5.2 to 0.5.3
@@ -611,2 +611,14 @@ // Generated by CoffeeScript 1.7.1 | ||
return schema.execFile(filename, errHandler); | ||
}, | ||
ping: function(argv) { | ||
var db, sql; | ||
sql = "select 1;"; | ||
db = dbInterface().schema; | ||
return db.exec(sql, function(err, result) { | ||
if (err) { | ||
return process.exit(1); | ||
} else { | ||
return process.exit(0); | ||
} | ||
}); | ||
} | ||
@@ -613,0 +625,0 @@ }; |
@@ -24,3 +24,3 @@ // Generated by CoffeeScript 1.7.1 | ||
showUsage = function() { | ||
return console.log("" + pkg.name + " " + pkg.version + "\n\nUsage: " + pkg.name + " [options] [command] [FILENAME.sql]\n\nCommands:\n\n console Runs database CLI\n createdb (Re)Create database from config.js and $NODE_ENV\n down Undo {COUNT|VERSION|all} migrations.\n dropdb Drops the database\n file Execute SQL script in file\n history Show migrations in database. (default)\n init Creates migration directory with config\n last Undo last dir if applied and migrate up\n new Generate new migration directory\n up Execute new migrations.\n exec Execute an expression.\n\nOptions:\n\n --directory use different directory than migrations\n --examples output examples\n -h, --help output usage information\n -V, --version output the version number"); | ||
return console.log("" + pkg.name + " " + pkg.version + "\n\nUsage: " + pkg.name + " [options] [command] [FILENAME.sql]\n\nCommands:\n\n console Runs database CLI\n createdb (Re)Create database from config.js and $NODE_ENV\n down Undo {COUNT|VERSION|all} migrations.\n dropdb Drops the database\n file Execute SQL script in file\n history Show migrations in database. (default)\n init Creates migration directory with config\n last Undo last dir if applied and migrate up\n new Generate new migration directory\n ping Pings the database (0 exit code means OK)\n up Execute new migrations.\n exec Execute an expression.\n\nOptions:\n\n --directory use different directory than migrations\n --examples output examples\n -h, --help output usage information\n -V, --version output the version number"); | ||
}; | ||
@@ -57,2 +57,3 @@ | ||
"new": commands.generate, | ||
ping: commands.ping, | ||
up: commands.migrateUp, | ||
@@ -59,0 +60,0 @@ exec: commands.execSql |
@@ -5,3 +5,3 @@ { | ||
"description": "SQL based migration utility for Postgres, Sql Server and MySQL", | ||
"version": "0.5.2", | ||
"version": "0.5.3", | ||
"bin": { | ||
@@ -8,0 +8,0 @@ "mygrate": "./bin/mygrate", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
93429
1558