Browse files

PostgreSQL does not support IF NOT EXISTS for table creation

  • Loading branch information...
1 parent e612118 commit 904685a220987550d71147c8eb18c459048aa2c8 @cmdrkeene cmdrkeene committed May 31, 2012
Showing with 12 additions and 0 deletions.
  1. +12 −0 lib/driver/pg.js
View
12 lib/driver/pg.js
@@ -32,6 +32,18 @@ var PgDriver = Base.extend({
return this._super(str);
},
+ createMigrationsTable: function(callback) {
+ var options = {
+ columns: {
+ 'id': { type: type.INTEGER, notNull: true, primaryKey: true, autoIncrement: true },
+ 'name': { type: type.STRING, length: 255, notNull: true},
+ 'run_on': { type: type.DATE_TIME, notNull: true}
+ },
+ ifNotExists: false
+ }
+ this.createTable('migrations', options, callback);
+ },
+
createColumnConstraint: function(spec, options) {
var constraint = [];
if (spec.primaryKey && options.emitPrimaryKey) {

0 comments on commit 904685a

Please sign in to comment.