Module Recettes : on avance... un peu...

This commit is contained in:
2021-04-29 19:05:43 +02:00
parent 8ccce53560
commit 30a5848cf9
12 changed files with 105 additions and 36 deletions

View File

@@ -14,10 +14,12 @@ CREATE TABLE `recipe`
`id` INTEGER NOT NULL AUTO_INCREMENT,
`content_id` INTEGER,
`title` VARCHAR(255) NOT NULL,
`summary` VARCHAR(255),
`people` INTEGER NOT NULL,
`difficulty` INTEGER NOT NULL,
`preparation_time` VARCHAR(255) NOT NULL,
`cooking_time` VARCHAR(255),
`other_ingredients` VARCHAR(255),
PRIMARY KEY (`id`),
INDEX `fi_content_content_id` (`content_id`),
CONSTRAINT `fk_content_content_id`
@@ -36,7 +38,7 @@ CREATE TABLE `recipe_steps`
`recipe_id` INTEGER NOT NULL,
`step` INTEGER NOT NULL,
`description` VARCHAR(255) NOT NULL,
INDEX `fi_recipesteps_recipe_id` (`recipe_id`),
PRIMARY KEY (`recipe_id`,`step`),
CONSTRAINT `fk_recipesteps_recipe_id`
FOREIGN KEY (`recipe_id`)
REFERENCES `recipe` (`id`)
@@ -52,8 +54,9 @@ CREATE TABLE `recipe_products`
(
`recipe_id` INTEGER NOT NULL,
`pse_id` INTEGER NOT NULL,
`quantity` INTEGER NOT NULL,
INDEX `fi_recipeproducts_recipe_id` (`recipe_id`),
`nb_of_products` INTEGER NOT NULL,
`quantity` VARCHAR(255) NOT NULL,
PRIMARY KEY (`recipe_id`,`pse_id`),
INDEX `fi_recipeproducts_pse_id` (`pse_id`),
CONSTRAINT `fk_recipeproducts_recipe_id`
FOREIGN KEY (`recipe_id`)