From 6fe1e7ceb525e7520d7796e66c0ff9fc91d2d463 Mon Sep 17 00:00:00 2001 From: Bonifatsiy Date: Mon, 11 May 2026 07:05:38 +0400 Subject: [PATCH] fix ddl v2 --- dsolovianov/postgresql/DDL.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dsolovianov/postgresql/DDL.sql b/dsolovianov/postgresql/DDL.sql index 033894c..c3a8393 100644 --- a/dsolovianov/postgresql/DDL.sql +++ b/dsolovianov/postgresql/DDL.sql @@ -21,6 +21,8 @@ CREATE TABLE dsolovianov.orders ( user_id INT, order_date TIMESTAMPTZ NOT NULL, status VARCHAR(20) + CONSTRAINT orders_user_fk + FOREIGN KEY (user_id) REFERENCES dsolovianov.users(id) ); CREATE TABLE dsolovianov.order_items ( @@ -32,7 +34,5 @@ CREATE TABLE dsolovianov.order_items ( CONSTRAINT order_items_order_fk FOREIGN KEY (order_id) REFERENCES dsolovianov.orders(id), CONSTRAINT order_items_product_fk - FOREIGN KEY (product_id) REFERENCES dsolovianov.products(id), - CONSTRAINT orders_user_fk - FOREIGN KEY (user_id) REFERENCES dsolovianov.users(id) + FOREIGN KEY (product_id) REFERENCES dsolovianov.products(id) ); \ No newline at end of file