Merge pull request #727 from chaotixkilla/feat-btc-transaction-batching
BTC transaction batching
This commit is contained in:
commit
cc8c48ff4c
19 changed files with 331 additions and 28 deletions
24
migrations/1621556014244-add-btc-tx-batching.js
Normal file
24
migrations/1621556014244-add-btc-tx-batching.js
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
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()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue