2025-02-23 23:56:23 +01:00
|
|
|
-- On retire les tables, dans le bon ordre !
|
2025-02-22 22:50:34 +00:00
|
|
|
|
2025-02-23 23:56:23 +01:00
|
|
|
DROP TABLE IF EXISTS `Reutilise`;
|
|
|
|
DROP TABLE IF EXISTS `RecetteUstensile`;
|
|
|
|
DROP TABLE IF EXISTS `RecettePreparation`;
|
|
|
|
DROP TABLE IF EXISTS `RecetteIngredient`;
|
|
|
|
DROP TABLE IF EXISTS `Recette`;
|
2025-02-22 22:50:34 +00:00
|
|
|
DROP TABLE IF EXISTS `Aime`;
|
2025-02-23 23:56:23 +01:00
|
|
|
DROP TABLE IF EXISTS `Preparation`;
|
|
|
|
DROP TABLE IF EXISTS `Ingredient`;
|
|
|
|
DROP TABLE IF EXISTS `Humain`;
|
|
|
|
DROP TABLE IF EXISTS `Genre`;
|
|
|
|
DROP TABLE IF EXISTS `Ustensile`;
|
|
|
|
DROP TABLE IF EXISTS `Unite`;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Table structure for table `Unite`
|
|
|
|
CREATE TABLE `Unite` (
|
|
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
|
nom mediumtext DEFAULT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
-- Table structure for table `Ustensile`
|
|
|
|
CREATE TABLE `Ustensile` (
|
|
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
|
`nom` mediumtext DEFAULT NULL
|
2025-02-22 22:50:34 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
-- Table structure for table `Genre`
|
|
|
|
CREATE TABLE `Genre` (
|
2025-02-23 23:56:23 +01:00
|
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
|
`nom` mediumtext DEFAULT NULL
|
2025-02-22 22:50:34 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
-- Table structure for table `Humain`
|
|
|
|
CREATE TABLE `Humain` (
|
2025-02-23 23:56:23 +01:00
|
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
|
`nom` mediumtext DEFAULT NULL
|
2025-02-22 22:50:34 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
-- Table structure for table `Ingredient`
|
|
|
|
CREATE TABLE `Ingredient` (
|
2025-02-23 23:56:23 +01:00
|
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
2025-02-22 22:50:34 +00:00
|
|
|
`nom` mediumtext DEFAULT NULL,
|
|
|
|
`jan` tinyint(1) DEFAULT NULL,
|
|
|
|
`fev` tinyint(1) DEFAULT NULL,
|
|
|
|
`mar` tinyint(1) DEFAULT NULL,
|
|
|
|
`avr` tinyint(1) DEFAULT NULL,
|
|
|
|
`mai` tinyint(1) DEFAULT NULL,
|
|
|
|
`jun` tinyint(1) DEFAULT NULL,
|
|
|
|
`jul` tinyint(1) DEFAULT NULL,
|
|
|
|
`aou` tinyint(1) DEFAULT NULL,
|
|
|
|
`sep` tinyint(1) DEFAULT NULL,
|
|
|
|
`ocb` tinyint(1) DEFAULT NULL,
|
|
|
|
`nov` tinyint(1) DEFAULT NULL,
|
2025-02-23 23:56:23 +01:00
|
|
|
`dem` tinyint(1) DEFAULT NULL
|
2025-02-22 22:50:34 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
-- Table structure for table `Preparation`
|
|
|
|
CREATE TABLE `Preparation` (
|
2025-02-23 23:56:23 +01:00
|
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
|
`nom` mediumtext DEFAULT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
-- Table structure for table `Aime`
|
|
|
|
CREATE TABLE `Aime` (
|
|
|
|
`ingredient` INTEGER DEFAULT NULL,
|
|
|
|
`humain` INTEGER DEFAULT NULL,
|
|
|
|
`niveau` tinyint(4) DEFAULT NULL,
|
|
|
|
PRIMARY KEY (ingredient, humain),
|
|
|
|
FOREIGN KEY (ingredient) REFERENCES Ingredient(id),
|
|
|
|
FOREIGN KEY (humain) REFERENCES Humain(id)
|
2025-02-22 22:50:34 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
-- Table structure for table `Recette`
|
|
|
|
CREATE TABLE `Recette` (
|
2025-02-23 23:56:23 +01:00
|
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
2025-02-22 22:50:34 +00:00
|
|
|
`nom` mediumtext DEFAULT NULL,
|
|
|
|
`tempsTotal` mediumtext DEFAULT NULL,
|
2025-02-23 23:56:23 +01:00
|
|
|
`genre` INTEGER DEFAULT NULL,
|
|
|
|
`unitePortion` INTEGER DEFAULT NULL,
|
2025-02-22 22:50:34 +00:00
|
|
|
`nbPortion` mediumtext DEFAULT NULL,
|
|
|
|
`realisation` mediumtext DEFAULT NULL,
|
|
|
|
`commentaire` mediumtext DEFAULT NULL,
|
2025-02-23 23:56:23 +01:00
|
|
|
FOREIGN KEY (genre) REFERENCES Genre(id),
|
|
|
|
FOREIGN KEY (unitePortion) REFERENCES Unite(id)
|
2025-02-22 22:50:34 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
-- Table structure for table `RecetteIngredient`
|
|
|
|
CREATE TABLE `RecetteIngredient` (
|
2025-02-23 23:56:23 +01:00
|
|
|
`ingredient` INTEGER NOT NULL,
|
|
|
|
`recette` INTEGER NOT NULL,
|
|
|
|
`quantite` mediumtext DEFAULT NULL,
|
|
|
|
`unite` INTEGER DEFAULT NULL,
|
|
|
|
PRIMARY KEY (`ingredient`, `recette`),
|
|
|
|
FOREIGN KEY (ingredient) REFERENCES Ingredient(id),
|
|
|
|
FOREIGN KEY (recette) REFERENCES Recette(id),
|
|
|
|
FOREIGN KEY (unite) REFERENCES Unite(id)
|
2025-02-22 22:50:34 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
-- Table structure for table `RecettePreparation`
|
|
|
|
CREATE TABLE `RecettePreparation` (
|
2025-02-23 23:56:23 +01:00
|
|
|
`preparation` INTEGER NOT NULL,
|
|
|
|
`recette` INTEGER NOT NULL,
|
|
|
|
`duree` INTEGER DEFAULT NULL,
|
2025-02-22 22:50:34 +00:00
|
|
|
`temperature` mediumtext DEFAULT NULL,
|
2025-02-23 23:56:23 +01:00
|
|
|
PRIMARY KEY (`preparation`,`recette`),
|
|
|
|
FOREIGN KEY (preparation) REFERENCES Preparation(id),
|
|
|
|
FOREIGN KEY (recette) REFERENCES Recette(id)
|
2025-02-22 22:50:34 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
-- Table structure for table `RecetteUstensile`
|
|
|
|
CREATE TABLE `RecetteUstensile` (
|
2025-02-23 23:56:23 +01:00
|
|
|
`ustensile` INTEGER NOT NULL,
|
|
|
|
`recette` INTEGER NOT NULL,
|
2025-02-22 22:50:34 +00:00
|
|
|
`commentaire` mediumtext DEFAULT NULL,
|
2025-02-23 23:56:23 +01:00
|
|
|
PRIMARY KEY (`ustensile`,`recette`),
|
|
|
|
FOREIGN KEY (ustensile) REFERENCES Ustensile(id),
|
|
|
|
FOREIGN KEY (recette) REFERENCES Recette(id)
|
2025-02-22 22:50:34 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
-- Table structure for table `Reutilise`
|
|
|
|
CREATE TABLE `Reutilise` (
|
2025-02-23 23:56:23 +01:00
|
|
|
`utilisee` INTEGER NOT NULL,
|
|
|
|
`utilisant` INTEGER NOT NULL,
|
2025-02-22 22:50:34 +00:00
|
|
|
`quantite` mediumtext DEFAULT NULL,
|
2025-02-23 23:56:23 +01:00
|
|
|
PRIMARY KEY (`utilisee`,`utilisant`),
|
|
|
|
FOREIGN KEY (utilisee) REFERENCES Recette(id),
|
|
|
|
FOREIGN KEY (utilisant) REFERENCES Recette(id)
|
2025-02-22 22:50:34 +00:00
|
|
|
);
|