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

View file

@ -0,0 +1,17 @@
'use strict';
var db = require('./db');
exports.up = function(next){
db.query('CREATE TABLE machine_events ( ' +
'id uuid PRIMARY KEY, ' +
'device_fingerprint text NOT NULL, ' +
'event_type text NOT NULL, ' +
'note text, ' +
'device_time bigint NOT NULL, ' +
'created timestamp NOT NULL DEFAULT now() )', next);
};
exports.down = function(next){
next();
};