Compare commits
2 commits
c186c3b515
...
fcde7e6f1e
Author | SHA1 | Date | |
---|---|---|---|
![]() |
fcde7e6f1e | ||
![]() |
c8752c388c |
2 changed files with 6 additions and 4 deletions
|
@ -3,7 +3,7 @@
|
||||||
--------------------------------------------
|
--------------------------------------------
|
||||||
|
|
||||||
-- Holds the different types of cookies we can make.
|
-- Holds the different types of cookies we can make.
|
||||||
CREATE TABLE cookies (
|
CREATE TABLE IF NOT EXISTS cookies (
|
||||||
cookie_id INT PRIMARY KEY,
|
cookie_id INT PRIMARY KEY,
|
||||||
cookie_name VARCHAR(50) NOT NULL UNIQUE
|
cookie_name VARCHAR(50) NOT NULL UNIQUE
|
||||||
);
|
);
|
||||||
|
@ -21,8 +21,8 @@ CREATE TABLE IF NOT EXISTS orders (
|
||||||
customer_id INT NOT NULL,
|
customer_id INT NOT NULL,
|
||||||
cookie_id INT NOT NULL,
|
cookie_id INT NOT NULL,
|
||||||
order_date DATE NOT NULL DEFAULT CURRENT_DATE CHECK (order_date >= CURRENT_DATE),
|
order_date DATE NOT NULL DEFAULT CURRENT_DATE CHECK (order_date >= CURRENT_DATE),
|
||||||
FOREIGN KEY (customer_id) REFERENCES customer(customer_id),
|
FOREIGN KEY (customer_id) REFERENCES customers(customer_id),
|
||||||
FOREIGN KEY (cookie_id) REFERENCES cookie(cookie_id)
|
FOREIGN KEY (cookie_id) REFERENCES cookies(cookie_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
--------------------------------------------
|
--------------------------------------------
|
||||||
|
@ -58,7 +58,7 @@ CREATE TABLE IF NOT EXISTS pallets (
|
||||||
order_id INT NOT NULL,
|
order_id INT NOT NULL,
|
||||||
status VARCHAR(50) NOT NULL CHECK (status IN ('freezer', 'delivered', 'blocked')),
|
status VARCHAR(50) NOT NULL CHECK (status IN ('freezer', 'delivered', 'blocked')),
|
||||||
production_date DATE NOT NULL,
|
production_date DATE NOT NULL,
|
||||||
FOREIGN KEY (cookie_id) REFERENCES cookie(cookie_id)
|
FOREIGN KEY (cookie_id) REFERENCES cookies(cookie_id)
|
||||||
FOREIGN KEY (order_id) REFERENCES orders(order_id)
|
FOREIGN KEY (order_id) REFERENCES orders(order_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
2
makefile
2
makefile
|
@ -8,6 +8,8 @@ run:
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
./gradlew clean
|
./gradlew clean
|
||||||
|
rm -f *.tar.gz *.tar.gz.minisig
|
||||||
|
rm -f app/krusty.db
|
||||||
|
|
||||||
test:
|
test:
|
||||||
./gradlew test
|
./gradlew test
|
||||||
|
|
Loading…
Reference in a new issue