Compare commits

...

2 Commits

Author SHA1 Message Date
c23b77ff0d add: DB primary key update 2023-01-12 14:49:58 +01:00
03a42f3ba7 add: DB primary key update 2023-01-12 14:46:46 +01:00

View File

@ -6,7 +6,7 @@ time_zone = "+00:00";
CREATE TABLE `ingredienti`
( /*Zutaten*/
`id` int auto_increment NOT NULL,
`id` int auto_increment NOT NULL PRIMARY KEY,
`cognome` varchar(200) NOT NULL, /*Name*/
`caloriePerCento` integer(5) NOT NULL, /*Kalorien pro Gramm*/
`ilPeso` integer(5) NULL, /*Gewicht*/
@ -16,14 +16,14 @@ CREATE TABLE `ingredienti`
CREATE TABLE `folla`
( /*Menge*/
`id` int auto_increment NOT NULL,
`id` int auto_increment NOT NULL PRIMARY KEY,
`unita` varchar(200) NOT NULL, /*Einheit*/
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `elenco`
( /*Liste*/
`id` int auto_increment NOT NULL,
`id` int auto_increment NOT NULL PRIMARY KEY,
`creatore` varchar(200) NOT NULL, /*Ersteller*/
`coloreDiSfondo` integer(10) NOT NULL, /*Hintergrundfarbe*/
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
@ -31,7 +31,7 @@ CREATE TABLE `elenco`
CREATE TABLE `utente`
( /*Benutzer*/
`id` int auto_increment NOT NULL,
`id` int auto_increment NOT NULL PRIMARY KEY,
`email` varchar(200) NOT NULL, /*Email*/
`parolaDordine` varchar(255) NOT NULL, /*Passwort*/
`nomeUtente` varchar(50) UNIQUE NOT NULL, /*Benutzernamen*/
@ -41,7 +41,7 @@ CREATE TABLE `utente`
CREATE TABLE `elencoIngredienti`
( /*Liste_Zutaten*/
`id` int auto_increment NOT NULL,
`id` int auto_increment NOT NULL PRIMARY KEY,
`ingredientiID` varchar(36) NOT NULL, /*ZutatenID*/
`elencoID` varchar(36) NOT NULL, /*ListeID*/
`follaID` varchar(36) NOT NULL, /*MengeID*/
@ -50,24 +50,12 @@ CREATE TABLE `elencoIngredienti`
CREATE TABLE `utenteElenco`
( /*Benutzer_Liste*/
`id` int auto_increment NOT NULL,
`id` int auto_increment NOT NULL PRIMARY KEY,
`elencoID` varchar(36) NOT NULL, /*ListeID*/
`utenteID` varchar(36) NOT NULL, /*BenutzerID*/
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `ingredienti` /*Zutaten*/
ADD PRIMARY KEY (`id`);
ALTER TABLE `folla` /*Menge*/
ADD PRIMARY KEY (`id`);
ALTER TABLE `elenco` /*Liste*/
ADD PRIMARY KEY (`id`);
ALTER TABLE `utente` /*Benutzer*/
ADD PRIMARY KEY (`id`);
ALTER TABLE `elencoIngredienti` /*Liste_Zutaten*/
ADD PRIMARY KEY (`id`),
ADD CONSTRAINT `FK_ElencoIngredienti_Ingredienti` FOREIGN KEY (`ingredientiID`) REFERENCES `ingredienti`(`id`), /*Liste_Zutaten hat Foreignkey von Zutaten(id)*/