Redundant deliveries table removed
This commit is contained in:
parent
fcde7e6f1e
commit
54939ca99b
1 changed files with 1 additions and 9 deletions
|
@ -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)
|
||||
);
|
Loading…
Reference in a new issue