ddl v4
This commit is contained in:
@@ -30,7 +30,7 @@ CREATE TABLE dsolovianov.order_items (
|
|||||||
product_id INT NOT NULL,
|
product_id INT NOT NULL,
|
||||||
quantity INT NOT NULL CHECK (quantity > 0),
|
quantity INT NOT NULL CHECK (quantity > 0),
|
||||||
price_at_purchase DECIMAL(10,2) NOT NULL CHECK (price_at_purchase > 0),
|
price_at_purchase DECIMAL(10,2) NOT NULL CHECK (price_at_purchase > 0),
|
||||||
CONSTRAINT order_items_pk PRIMARY KEY (order_id, product_id)
|
CONSTRAINT order_items_pk PRIMARY KEY (order_id, product_id),
|
||||||
CONSTRAINT order_items_order_fk
|
CONSTRAINT order_items_order_fk
|
||||||
FOREIGN KEY (order_id) REFERENCES dsolovianov.orders(id),
|
FOREIGN KEY (order_id) REFERENCES dsolovianov.orders(id),
|
||||||
CONSTRAINT order_items_product_fk
|
CONSTRAINT order_items_product_fk
|
||||||
|
|||||||
Reference in New Issue
Block a user