Add discount value constraints (#254)
This commit is contained in:
@@ -0,0 +1,6 @@
|
|||||||
|
ALTER TABLE discount_codes ADD CONSTRAINT valid_values CHECK (
|
||||||
|
value >= 0
|
||||||
|
and (
|
||||||
|
type != '%' or (type = '%' and value <= 100)
|
||||||
|
)
|
||||||
|
);
|
||||||
Reference in New Issue
Block a user