Merge pull request #430 from shine-on/master

Drop table if exists
This commit is contained in:
Brian C 2013-09-01 19:22:06 -07:00
commit a4caea51be
2 changed files with 4 additions and 1 deletions

View File

@ -40,7 +40,7 @@ var con = new pg.Client({
con.connect(); con.connect();
if(args.down) { if(args.down) {
console.log("Dropping table 'person'") console.log("Dropping table 'person'")
var query = con.query("drop table person"); var query = con.query("drop table if exists person");
query.on('end', function() { query.on('end', function() {
console.log("Dropped!"); console.log("Dropped!");
con.end(); con.end();

View File

@ -9,6 +9,9 @@ for(var i = 0; i < process.argv.length; i++) {
case 'binary': case 'binary':
config.binary = true; config.binary = true;
break; break;
case 'down':
config.down = true;
break;
default: default:
break; break;
} }