add migrations
This commit is contained in:
parent
c38372a173
commit
e650e591d5
6 changed files with 163 additions and 0 deletions
17
migrations/003-device-events.js
Normal file
17
migrations/003-device-events.js
Normal 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();
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue