This commit is contained in:
Bonifatsiy
2026-05-11 07:07:01 +04:00
parent 52481d3186
commit bfc54f9dcf
+1 -1
View File
@@ -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