feat: individual discounts creation form

feat: individual discounts deletion
fix: discounts mapping from db
This commit is contained in:
Sérgio Salgado 2021-07-22 17:19:45 +01:00 committed by Josh Harvey
parent 07f15db851
commit 768b5a30e1
8 changed files with 435 additions and 19 deletions

View file

@ -10,7 +10,7 @@ exports.up = function (next) {
discount SMALLINT NOT NULL,
soft_deleted BOOLEAN DEFAULT false
)`,
`CREATE UNIQUE INDEX uq_individual_discount ON individual_discounts (value) WHERE NOT soft_deleted`
`CREATE UNIQUE INDEX uq_individual_discount ON individual_discounts (identification, value) WHERE NOT soft_deleted`
]
db.multi(sql, next)