Skip to content

Commit

Permalink
Merge pull request #13 from groupme/master
Browse files Browse the repository at this point in the history
PostgreSQL does not support IF NOT EXISTS for CREATE TABLE.

Sorry for missing this pull request until now.
  • Loading branch information
Jeff Kunkle committed Jun 5, 2012
2 parents e612118 + 904685a commit 3397917
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/driver/pg.js
Expand Up @@ -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) {
Expand Down

0 comments on commit 3397917

Please sign in to comment.