Fick problem när tablen hette Order bytte till Orders istället
This commit is contained in:
parent
bb202505c1
commit
780917069d
1 changed files with 4 additions and 4 deletions
8
sqlCode
8
sqlCode
|
@ -3,7 +3,7 @@ DROP TABLE IF EXISTS Recipe;
|
||||||
DROP TABLE IF EXISTS Ingredient;
|
DROP TABLE IF EXISTS Ingredient;
|
||||||
DROP TABLE IF EXISTS Cookie;
|
DROP TABLE IF EXISTS Cookie;
|
||||||
DROP TABLE IF EXISTS Pallet;
|
DROP TABLE IF EXISTS Pallet;
|
||||||
DROP TABLE IF EXISTS Order;
|
DROP TABLE IF EXISTS Orders;
|
||||||
DROP TABLE IF EXISTS Customer;
|
DROP TABLE IF EXISTS Customer;
|
||||||
|
|
||||||
CREATE TABLE Customer (
|
CREATE TABLE Customer (
|
||||||
|
@ -12,7 +12,7 @@ CREATE TABLE Customer (
|
||||||
address VARCHAR(255)
|
address VARCHAR(255)
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE Order (
|
CREATE TABLE Orders (
|
||||||
order_id INT AUTO_INCREMENT PRIMARY KEY,
|
order_id INT AUTO_INCREMENT PRIMARY KEY,
|
||||||
customer_id INT,
|
customer_id INT,
|
||||||
delivery_date DATE,
|
delivery_date DATE,
|
||||||
|
@ -26,7 +26,7 @@ CREATE TABLE Pallet (
|
||||||
manufacture_date DATE,
|
manufacture_date DATE,
|
||||||
delivery_date DATE,
|
delivery_date DATE,
|
||||||
blocked BOOLEAN,
|
blocked BOOLEAN,
|
||||||
FOREIGN KEY (order_id) REFERENCES Order(order_id)
|
FOREIGN KEY (order_id) REFERENCES Orders(order_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE Cookie (
|
CREATE TABLE Cookie (
|
||||||
|
@ -41,7 +41,7 @@ CREATE TABLE OrderSpec (
|
||||||
cookie_id INT,
|
cookie_id INT,
|
||||||
quantity INT,
|
quantity INT,
|
||||||
PRIMARY KEY (order_id, cookie_id),
|
PRIMARY KEY (order_id, cookie_id),
|
||||||
FOREIGN KEY (order_id) REFERENCES Order(order_id),
|
FOREIGN KEY (order_id) REFERENCES Orders(order_id),
|
||||||
FOREIGN KEY (cookie_id) REFERENCES Cookie(cookie_id)
|
FOREIGN KEY (cookie_id) REFERENCES Cookie(cookie_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue