lamassu-server/migrations/1621556014244-add-btc-tx-batching.js
Sérgio Salgado 00c38ea721 feat: add batch_time and batched to cash_in_txs
feat: add batched flag to clear tx to send
feat: add batch information to front-end
feat: change transaction sending info on batch sending
fix: batching support function added to all wallet plugins
fix: mock-wallet batching check
feat: send machine information about batchable coins
2021-11-24 22:21:40 +00:00

24 lines
746 B
JavaScript

var db = require('./db')
exports.up = function (next) {
var sql = [
`CREATE TYPE transaction_batch_status AS ENUM('open', 'ready', 'failed', 'sent')`,
`CREATE TABLE transaction_batches (
id UUID PRIMARY KEY,
crypto_code TEXT NOT NULL,
status transaction_batch_status NOT NULL DEFAULT 'open',
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
closed_at TIMESTAMPTZ,
error_message TEXT
)`,
`ALTER TABLE cash_in_txs ADD COLUMN batch_id UUID REFERENCES transaction_batches(id)`,
`ALTER TABLE cash_in_txs ADD COLUMN batched BOOLEAN NOT NULL DEFAULT false`,
`ALTER TABLE cash_in_txs ADD COLUMN batch_time TIMESTAMPTZ`
]
db.multi(sql, next)
}
exports.down = function (next) {
next()
}