Permalink
Browse files

Merge pull request #15 from romanostolosh-devpronet/master

Fixed renameTable method of PG driver
  • Loading branch information...
2 parents 7ecf028 + 8a4f818 commit 37fd9899775770368faeb263cc47b56123f40317 @kunklejr kunklejr committed Jun 6, 2012
Showing with 2 additions and 3 deletions.
  1. +2 −3 lib/driver/pg.js
View
@@ -51,9 +51,8 @@ var PgDriver = Base.extend({
if (spec.primaryKey && options.emitPrimaryKey) {
if (spec.autoIncrement) {
constraint.push('SERIAL');
- } else {
- constraint.push('PRIMARY KEY');
}
+ constraint.push('PRIMARY KEY');
}
if (spec.notNull) {
@@ -77,7 +76,7 @@ var PgDriver = Base.extend({
},
renameTable: function(tableName, newTableName, callback) {
- var sql = util.format('RENAME TABLE %s TO %s', tableName, newTableName);
+ var sql = util.format('ALTER TABLE %s RENAME TABLE TO %s', tableName, newTableName);
this.runSql(sql, callback);
},

0 comments on commit 37fd989

Please sign in to comment.