v12.0.0 - initial commit
This commit is contained in:
commit
e2c49ea43c
1145 changed files with 97211 additions and 0 deletions
18
packages/server/migrations/1603886141913-coupon-codes.js
Normal file
18
packages/server/migrations/1603886141913-coupon-codes.js
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
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.runAll(sql, next)
|
||||
}
|
||||
|
||||
exports.down = function (next) {
|
||||
next()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue