add: DB primary key update

This commit is contained in:
Don Bock 2023-01-12 14:49:58 +01:00
parent 03a42f3ba7
commit c23b77ff0d

View File

@ -6,60 +6,54 @@ time_zone = "+00:00";
CREATE TABLE `ingredienti` CREATE TABLE `ingredienti`
( /*Zutaten*/ ( /*Zutaten*/
`id` int auto_increment NOT NULL, `id` int auto_increment NOT NULL PRIMARY KEY,
`cognome` varchar(200) NOT NULL, /*Name*/ `cognome` varchar(200) NOT NULL, /*Name*/
`caloriePerCento` integer(5) NOT NULL, /*Kalorien pro Gramm*/ `caloriePerCento` integer(5) NOT NULL, /*Kalorien pro Gramm*/
`ilPeso` integer(5) NULL, /*Gewicht*/ `ilPeso` integer(5) NULL, /*Gewicht*/
`prezzo` decimal(4, 2) NOT NULL, /*Preis*/ `prezzo` decimal(4, 2) NOT NULL, /*Preis*/
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `folla` CREATE TABLE `folla`
( /*Menge*/ ( /*Menge*/
`id` int auto_increment NOT NULL, `id` int auto_increment NOT NULL PRIMARY KEY,
`unita` varchar(200) NOT NULL, /*Einheit*/ `unita` varchar(200) NOT NULL, /*Einheit*/
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `elenco` CREATE TABLE `elenco`
( /*Liste*/ ( /*Liste*/
`id` int auto_increment NOT NULL, `id` int auto_increment NOT NULL PRIMARY KEY,
`creatore` varchar(200) NOT NULL, /*Ersteller*/ `creatore` varchar(200) NOT NULL, /*Ersteller*/
`coloreDiSfondo` integer(10) NOT NULL, /*Hintergrundfarbe*/ `coloreDiSfondo` integer(10) NOT NULL, /*Hintergrundfarbe*/
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `utente` CREATE TABLE `utente`
( /*Benutzer*/ ( /*Benutzer*/
`id` int auto_increment NOT NULL, `id` int auto_increment NOT NULL PRIMARY KEY,
`email` varchar(200) NOT NULL, /*Email*/ `email` varchar(200) NOT NULL, /*Email*/
`parolaDordine` varchar(255) NOT NULL, /*Passwort*/ `parolaDordine` varchar(255) NOT NULL, /*Passwort*/
`nomeUtente` varchar(50) UNIQUE NOT NULL, /*Benutzernamen*/ `nomeUtente` varchar(50) UNIQUE NOT NULL, /*Benutzernamen*/
`gettone` varchar(255), /*Token für Session*/ `gettone` varchar(255), /*Token für Session*/
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `elencoIngredienti` CREATE TABLE `elencoIngredienti`
( /*Liste_Zutaten*/ ( /*Liste_Zutaten*/
`id` int auto_increment NOT NULL, `id` int auto_increment NOT NULL PRIMARY KEY,
`ingredientiID` varchar(36) NOT NULL, /*ZutatenID*/ `ingredientiID` varchar(36) NOT NULL, /*ZutatenID*/
`elencoID` varchar(36) NOT NULL, /*ListeID*/ `elencoID` varchar(36) NOT NULL, /*ListeID*/
`follaID` varchar(36) NOT NULL, /*MengeID*/ `follaID` varchar(36) NOT NULL, /*MengeID*/
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `utenteElenco` CREATE TABLE `utenteElenco`
( /*Benutzer_Liste*/ ( /*Benutzer_Liste*/
`id` int auto_increment NOT NULL, `id` int auto_increment NOT NULL PRIMARY KEY,
`elencoID` varchar(36) NOT NULL, /*ListeID*/ `elencoID` varchar(36) NOT NULL, /*ListeID*/
`utenteID` varchar(36) NOT NULL, /*BenutzerID*/ `utenteID` varchar(36) NOT NULL, /*BenutzerID*/
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `elencoIngredienti` /*Liste_Zutaten*/ ALTER TABLE `elencoIngredienti` /*Liste_Zutaten*/