Skip to content

Commit

Permalink
Add is_attending_brunch column to guests table
Browse files Browse the repository at this point in the history
  • Loading branch information
ericf committed Sep 15, 2013
1 parent 4200f34 commit 7747d9d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/guests.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ var pg = require('pg'),
UPDATE_GUEST = 'UPDATE guests SET $UPDATES WHERE id=$1',

UPDATE_SCHEMA = {
title : true,
name : true,
is_attending: true,
meal : true
title : true,
name : true,
is_attending : true,
is_attending_brunch: true,
meal : true
};

exports.MEALS = [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
var async = require('async'),
dbm = require('db-migrate'),
type = dbm.dataType;

exports.up = function (db, callback) {
db.addColumn('guests', 'is_attending_brunch', {
type : 'boolean',
defaultValue: true,
notNull : true
}, callback);
};

exports.down = function (db, callback) {
db.removeColumn('guests', 'is_attending_brunch', callback);
};

0 comments on commit 7747d9d

Please sign in to comment.