diff --git a/app/Migrations/create-schema.sql b/app/Migrations/create-schema.sql index f98f253..20c1aa6 100644 --- a/app/Migrations/create-schema.sql +++ b/app/Migrations/create-schema.sql @@ -3,7 +3,7 @@ -------------------------------------------- -- Holds the different types of cookies we can make. -CREATE TABLE cookies ( +CREATE TABLE IF NOT EXISTS cookies ( cookie_id INT PRIMARY KEY, cookie_name VARCHAR(50) NOT NULL UNIQUE ); @@ -21,8 +21,8 @@ CREATE TABLE IF NOT EXISTS orders ( customer_id INT NOT NULL, cookie_id INT NOT NULL, order_date DATE NOT NULL DEFAULT CURRENT_DATE CHECK (order_date >= CURRENT_DATE), - FOREIGN KEY (customer_id) REFERENCES customer(customer_id), - FOREIGN KEY (cookie_id) REFERENCES cookie(cookie_id) + FOREIGN KEY (customer_id) REFERENCES customers(customer_id), + FOREIGN KEY (cookie_id) REFERENCES cookies(cookie_id) ); -------------------------------------------- @@ -58,7 +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, - FOREIGN KEY (cookie_id) REFERENCES cookie(cookie_id) + FOREIGN KEY (cookie_id) REFERENCES cookies(cookie_id) FOREIGN KEY (order_id) REFERENCES orders(order_id) ); diff --git a/makefile b/makefile index d74125e..2d93e37 100644 --- a/makefile +++ b/makefile @@ -8,6 +8,8 @@ run: clean: ./gradlew clean + rm -f *.tar.gz *.tar.gz.minisig + rm -f app/krusty.db test: ./gradlew test