Permalink
Browse files

Added removeColumn and renameColumn

  • Loading branch information...
Roman Ostolosh Roman Ostolosh
Roman Ostolosh authored and Roman Ostolosh committed May 28, 2012
1 parent 087e625 commit 2f32752d16255fb7be10a498d2d969e85330dabb
Showing with 8 additions and 4 deletions.
  1. +8 −4 lib/driver/pg.js
View
@@ -67,11 +67,15 @@ var PgDriver = Base.extend({
this.runSql(sql, callback);
},
- //removeColumn: function(tableName, columnName, callback) {
- //},
+ removeColumn: function(tableName, columnName, callback) {
+ var sql = util.format("ALTER TABLE %s DROP COLUMN %s", tableName, columnName);
+ this.runSql(sql, callback);
+ },
- //renameColumn: function(tableName, oldColumnName, newColumnName, callback) {
- //};
+ renameColumn: function(tableName, oldColumnName, newColumnName, callback) {
+ var sql = util.format("ALTER TABLE %s RENAME COLUMN %s TO %s", tableName, oldColumnName, newColumnName);
+ this.runSql(sql, callback)
+ },
//changeColumn: function(tableName, columnName, columnSpec, callback) {
//},

0 comments on commit 2f32752

Please sign in to comment.