lamassu-server/migrations/015-paired_devices.js
Fabio Cigliano 12c834469c Migration sql changes (#199)
* safe migration script changes

* lamassu migration script fixes
2018-11-01 13:26:48 +02:00

17 lines
367 B
JavaScript

var db = require('./db')
exports.up = function (next) {
var sql = [
db.dropColumn('devices', 'authorized'),
db.dropColumn('devices', 'unpair'),
`CREATE TABLE IF NOT EXISTS paired_devices (
device_id text PRIMARY KEY,
created timestamptz NOT NULL default now()
)`
]
db.multi(sql, next)
}
exports.down = function (next) {
next()
}