lamassu-server/migrations/012-add-hd-path-serial.js
Fabio Cigliano 12c834469c Migration sql changes (#199)
* safe migration script changes

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

19 lines
432 B
JavaScript

var db = require('./db')
exports.up = function (next) {
var sql = [
`CREATE TABLE IF NOT EXISTS cash_out_hds (
session_id uuid PRIMARY KEY,
crypto_code text NOT NULL,
hd_serial integer NOT NULL,
swept boolean NOT NULL default false,
created timestamptz NOT NULL default now(),
unique (crypto_code, hd_serial)
)`
]
db.multi(sql, next)
}
exports.down = function (next) {
next()
}