feat: add coupons table feat: add coupons to schema fix: coupon schema feat: coupon table feat: add coupon top button feat: add first coupon button feat: delete coupon feat: coupon modal fix: clear discount on modal close fix: modal input formatting feat: add new coupons fix: button positioning fix: remove loyalty panel sidebar fix: coupon screen matching specs fix: coupon modal feat: send coupon data to machine on poll fix: available coupons bool feat: coupon endpoint feat: transaction discount migration feat: post-discount rates refactor: bills feat: version string fix: bill saving on db feat: coupon soft-delete fix: coupon soft delete fix: bill receiving feat: remove cryptoAtoms update during tx fix: tx trading fix: bills feat: start trades rework fix: remove code fix: code review
19 lines
411 B
JavaScript
19 lines
411 B
JavaScript
var db = require('./db')
|
|
|
|
exports.up = function (next) {
|
|
const sql =
|
|
[
|
|
`create table coupons (
|
|
id uuid primary key,
|
|
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`
|
|
]
|
|
|
|
db.multi(sql, next)
|
|
}
|
|
|
|
exports.down = function (next) {
|
|
next()
|
|
}
|