fix: review

This commit is contained in:
Sérgio Salgado 2021-01-07 10:43:16 +00:00 committed by Josh Harvey
parent 772805269f
commit 5045821593
9 changed files with 62 additions and 172 deletions

View file

@ -8,7 +8,7 @@ exports.up = function (next) {
code TEXT NOT NULL,
discount SMALLINT NOT NULL,
soft_deleted BOOLEAN DEFAULT false )`,
`CREATE UNIQUE INDEX uq_code ON coupons USING btree(code) WHERE NOT soft_deleted`
`CREATE UNIQUE INDEX uq_code ON coupons (code) WHERE NOT soft_deleted`
]
db.multi(sql, next)

View file

@ -1,16 +0,0 @@
const db = require('./db')
exports.up = function (next) {
var sql = [
'ALTER TABLE trades ADD COLUMN tx_in_id UUID UNIQUE',
'ALTER TABLE trades ADD CONSTRAINT fk_tx_in FOREIGN KEY (tx_in_id) REFERENCES cash_in_txs (id)',
'ALTER TABLE trades ADD COLUMN tx_out_id UUID UNIQUE',
'ALTER TABLE trades ADD CONSTRAINT fk_tx_out FOREIGN KEY (tx_in_id) REFERENCES cash_out_txs (id)'
]
db.multi(sql, next)
}
exports.down = function (next) {
next()
}