add migrations

This commit is contained in:
Josh Harvey 2014-11-19 19:15:13 -05:00
parent c38372a173
commit e650e591d5
6 changed files with 163 additions and 0 deletions

20
migrations/002-bills.js Normal file
View file

@ -0,0 +1,20 @@
'use strict';
var db = require('./db');
exports.up = function(next){
db.query('CREATE TABLE bills ( ' +
'id uuid PRIMARY KEY, ' +
'device_fingerprint text NOT NULL, ' +
'denomination integer NOT NULL, ' +
'currency_code text NOT NULL, ' +
'satoshis integer NOT NULL, ' +
'to_address text NOT NULL, ' +
'session_id uuid NOT NULL, ' +
'device_time bigint NOT NULL, ' +
'created timestamp NOT NULL DEFAULT now() )', next);
};
exports.down = function(next){
next();
};