add: DB primary key update
This commit is contained in:
parent
1d80d93b1d
commit
03a42f3ba7
@ -12,6 +12,7 @@ CREATE TABLE `ingredienti`
|
|||||||
`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`
|
||||||
@ -19,6 +20,7 @@ CREATE TABLE `folla`
|
|||||||
`id` int auto_increment NOT NULL,
|
`id` int auto_increment NOT NULL,
|
||||||
`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`
|
||||||
@ -27,6 +29,7 @@ CREATE TABLE `elenco`
|
|||||||
`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`
|
||||||
@ -37,6 +40,7 @@ CREATE TABLE `utente`
|
|||||||
`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`
|
||||||
@ -46,6 +50,7 @@ CREATE TABLE `elencoIngredienti`
|
|||||||
`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`
|
||||||
@ -54,20 +59,9 @@ CREATE TABLE `utenteElenco`
|
|||||||
`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 `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*/
|
ALTER TABLE `elencoIngredienti` /*Liste_Zutaten*/
|
||||||
ADD PRIMARY KEY (`id`),
|
ADD PRIMARY KEY (`id`),
|
||||||
ADD CONSTRAINT `FK_ElencoIngredienti_Ingredienti` FOREIGN KEY (`ingredientiID`) REFERENCES `ingredienti`(`id`), /*Liste_Zutaten hat Foreignkey von Zutaten(id)*/
|
ADD CONSTRAINT `FK_ElencoIngredienti_Ingredienti` FOREIGN KEY (`ingredientiID`) REFERENCES `ingredienti`(`id`), /*Liste_Zutaten hat Foreignkey von Zutaten(id)*/
|
||||||
|
Loading…
Reference in New Issue
Block a user