chore: use monorepo organization
This commit is contained in:
parent
deaf7d6ecc
commit
a687827f7e
1099 changed files with 8184 additions and 11535 deletions
19
packages/server/migrations/1603886141913-coupon-codes.js
Normal file
19
packages/server/migrations/1603886141913-coupon-codes.js
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
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 (code) WHERE NOT soft_deleted`
|
||||
]
|
||||
|
||||
db.multi(sql, next)
|
||||
}
|
||||
|
||||
exports.down = function (next) {
|
||||
next()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue