From e79fab26efbfee65d1fc29aac6f68a17e5a37d22 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Mon, 22 Apr 2024 13:27:42 +0200 Subject: [PATCH 1/2] Added table migrations to project instead of submodule --- app/Migrations/0010-tables.sql | 88 ++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 app/Migrations/0010-tables.sql diff --git a/app/Migrations/0010-tables.sql b/app/Migrations/0010-tables.sql new file mode 100644 index 0000000..23f64bd --- /dev/null +++ b/app/Migrations/0010-tables.sql @@ -0,0 +1,88 @@ +CREATE TABLE IF NOT EXISTS Customers ( + CustomerID int PRIMARY KEY, + Name varchar(100), + Address varchar(255) +); + +CREATE TABLE IF NOT EXISTS Products ( + ProductID int PRIMARY KEY, + Name varchar(100) +); + +CREATE TABLE IF NOT EXISTS Recipes ( + RecipeName varchat(100), + RecipeYear Year, + ingrediences int, + ProductID int, + PRIMARY KEY (RecipeName, RecipeYear), + FOREIGN KEY (ingrediences) REFERENCES ingredience(IngredienceID), + FOREIGN KEY (ProductID) REFERENCES Products(ProductID) +); + +CREATE TABLE IF NOT EXISTS ingredience ( + IngredienceID int PRIMARY KEY, + RawMaterialName varchar(100), + amount int, + unit varchar(50), + FOREIGN KEY (RawMaterialName) REFERENCES RawMaterials(RawMaterialName) +); + +CREATE TABLE IF NOT EXISTS RawMaterials ( + RawMaterialName varchar(100) PRIMARY KEY, + Quantity int, + LastDeliveryDateTime datetime +); + +CREATE TABLE IF NOT EXISTS PalletsProduced ( + PalletID int PRIMARY KEY, + ProductID int, + ProductionDateTime datetime, + FOREIGN KEY (ProductID) REFERENCES Products (ProductID) +); + +CREATE TABLE IF NOT EXISTS PalletsDelivered ( + DeliveredID int PRIMARY KEY, + PalletID int, + DeliveryDateTime datetime, + FOREIGN KEY (PalletID) REFERENCES PalletsProduced (PalletID), + FOREIGN KEY (DeliveredID) REFERENCES Truck (Pallet) +); + +CREATE TABLE IF NOT EXISTS Truck ( + truckId int PRIMARY KEY, + capacity int, + Pallet int +); + +CREATE TABLE IF NOT EXISTS loadingBill ( + LoadingbillID int PRIMARY KEY, + adress varchar(100), + customer varchar(100), + truckID int, + FOREIGN KEY (truckID) REFERENCES Truck (truckId) +); + +CREATE TABLE IF NOT EXISTS Orders ( + OrderID int PRIMARY KEY, + CustomerID int, + ProductID int, + Quantity int, + OrderDateTime datetime, + FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID), + FOREIGN KEY (ProductID) REFERENCES Products (ProductID) +); + +CREATE TABLE IF NOT EXISTS BlockedProducts ( + BlockedProductID int PRIMARY KEY, + ProductID int, + BlockedDateTime datetime, + FOREIGN KEY (ProductID) REFERENCES Products (ProductID) +); + +CREATE TABLE IF NOT EXISTS PalletTraceability ( + TraceID int PRIMARY KEY, + location varchar(100), + locationdate datetime, + PalletID int, + FOREIGN KEY (PalletID) REFERENCES PalletsProduced (PalletID) +); From 7f67fe30c11d8eafb915cb1c3f9f946cb3ef344d Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Mon, 22 Apr 2024 13:27:51 +0200 Subject: [PATCH 2/2] Removed submodule --- .gitmodules | 3 --- app/CrustyCookies | 1 - 2 files changed, 4 deletions(-) delete mode 100644 .gitmodules delete mode 160000 app/CrustyCookies diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 4dd2e1b..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "app/CrustyCookies"] - path = app/CrustyCookies - url = https://git.silversoft.se/Imbus/CrustyCookies.git diff --git a/app/CrustyCookies b/app/CrustyCookies deleted file mode 160000 index be904a7..0000000 --- a/app/CrustyCookies +++ /dev/null @@ -1 +0,0 @@ -Subproject commit be904a7ab3925f7bbf3b54126e25480476ae49e8