refactor: remove extra conditions and fields renaming

This commit is contained in:
José Oliveira 2021-05-14 17:05:53 +01:00 committed by Josh Harvey
parent b0bbb2983f
commit 0c0133d01c
2 changed files with 21 additions and 31 deletions

View file

@ -3,14 +3,14 @@ const db = require('./db')
exports.up = function (next) {
var sql = [
`CREATE TABLE cashout_tx_trades (
cash_out_tx_id uuid REFERENCES cash_out_txs(id),
tx_id uuid REFERENCES cash_out_txs(id),
trade_id serial REFERENCES trades(id),
CONSTRAINT cashout_trade_pkey PRIMARY KEY (cash_out_tx_id,trade_id)
CONSTRAINT cashout_trade_pkey PRIMARY KEY (tx_id,trade_id)
)`,
`CREATE TABLE cashin_tx_trades (
cash_in_tx_id uuid REFERENCES cash_in_txs(id),
tx_id uuid REFERENCES cash_in_txs(id),
trade_id serial REFERENCES trades(id),
CONSTRAINT cashin_trade_pkey PRIMARY KEY (cash_in_tx_id,trade_id)
CONSTRAINT cashin_trade_pkey PRIMARY KEY (tx_id,trade_id)
)`
]