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

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

20 lines
452 B
JavaScript

var db = require('./db')
exports.up = function (next) {
var sql = [
db.defineEnum('trade_type', "'buy', 'sell'"),
`create table if not exists trades (
id serial PRIMARY KEY,
type trade_type not null,
crypto_code text not null,
crypto_atoms bigint not null,
fiat_code text not null,
created timestamptz NOT NULL default now()
)`
]
db.multi(sql, next)
}
exports.down = function (next) {
next()
}