From 54939ca99be4e3711ba282b5ae2258980310780e Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Sat, 4 May 2024 14:17:48 +0200 Subject: [PATCH] Redundant deliveries table removed --- app/Migrations/create-schema.sql | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/app/Migrations/create-schema.sql b/app/Migrations/create-schema.sql index 20c1aa6..3517751 100644 --- a/app/Migrations/create-schema.sql +++ b/app/Migrations/create-schema.sql @@ -58,15 +58,7 @@ CREATE TABLE IF NOT EXISTS pallets ( order_id INT NOT NULL, status VARCHAR(50) NOT NULL CHECK (status IN ('freezer', 'delivered', 'blocked')), production_date DATE NOT NULL, + delivery_date DATE DEFAULT NULL, FOREIGN KEY (cookie_id) REFERENCES cookies(cookie_id) FOREIGN KEY (order_id) REFERENCES orders(order_id) ); - --- Has an order been delivered? -CREATE TABLE IF NOT EXISTS deliveries ( - delivery_id INT PRIMARY KEY, - pallet_id INT NOT NULL, - customer_name VARCHAR(50) NOT NULL, - delivery_date DATE NOT NULL DEFAULT CURRENT_DATE CHECK (delivery_date >= CURRENT_DATE), - FOREIGN KEY (pallet_id) REFERENCES pallets(pallet_id) -); \ No newline at end of file