CREATE DATABASE  IF NOT EXISTS `151_ldm_db_recipe` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `151_ldm_db_recipe`;
--
-- Host: localhost    Database: 151_ldm_db_recipe
-- ------------------------------------------------------


--
-- Table structure for table `t_ingredient`
--

CREATE TABLE `t_ingredient` (
  `PK_Ingredient` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(45) NOT NULL,
  PRIMARY KEY (`PK_Ingredient`),
  UNIQUE KEY `Name_UNIQUE` (`Name`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `t_ingredient`
--

INSERT INTO `t_ingredient` VALUES (2,'papet vaudois'),(1,'vous');

--
-- Table structure for table `t_recipe`
--

CREATE TABLE `t_recipe` (
  `PK_Recipe` int(11) NOT NULL AUTO_INCREMENT,
  `FK_User` int(11) NOT NULL,
  `Name` varchar(45) DEFAULT NULL,
  `Description` text,
  `Image` text,
  PRIMARY KEY (`PK_Recipe`),
  KEY `fk_T_Recipe_T_User_idx` (`FK_User`),
  CONSTRAINT `fk_T_Recipe_T_User` FOREIGN KEY (`FK_User`) REFERENCES `t_user` (`PK_User`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `t_recipe`
--

INSERT INTO `t_recipe` VALUES (1,1,'papet vaudois','c\'est délicieux','http://image.over-blog.com/lPSFDrxD1cCe3ReVC-jde6WeJjA=/filters:no_upscale()/image%2F1029700%2F20201004%2Fob_f708de_20200928-195703-2.jpg');

--
-- Table structure for table `t_step`
--

CREATE TABLE `t_step` (
  `PK_Step` int(11) NOT NULL AUTO_INCREMENT,
  `Priority` int(11) NOT NULL,
  `Description` text NOT NULL,
  `FK_Recipe` int(11) NOT NULL,
  PRIMARY KEY (`PK_Step`),
  KEY `fk_T_Step_T_Recipe1_idx` (`FK_Recipe`),
  CONSTRAINT `fk_T_Step_T_Recipe1` FOREIGN KEY (`FK_Recipe`) REFERENCES `t_recipe` (`PK_Recipe`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `t_step`
--

INSERT INTO `t_step` VALUES (1,1,'mange le papet',1),(2,2,'digeste le papet',1);

--
-- Table structure for table `tr_recipe_ingredient`
--

CREATE TABLE `tr_recipe_ingredient` (
  `FPK_Ingredient` int(11) NOT NULL,
  `FPK_Recipe` int(11) NOT NULL,
  `Quantity` varchar(45) NOT NULL,
  PRIMARY KEY (`FPK_Ingredient`,`FPK_Recipe`),
  KEY `fk_T_Ingredient_has_T_Recipe_T_Recipe1_idx` (`FPK_Recipe`),
  KEY `fk_T_Ingredient_has_T_Recipe_T_Ingredient1_idx` (`FPK_Ingredient`),
  CONSTRAINT `fk_T_Ingredient_has_T_Recipe_T_Ingredient1` FOREIGN KEY (`FPK_Ingredient`) REFERENCES `t_ingredient` (`PK_Ingredient`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_T_Ingredient_has_T_Recipe_T_Recipe1` FOREIGN KEY (`FPK_Recipe`) REFERENCES `t_recipe` (`PK_Recipe`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `tr_recipe_ingredient`
--

INSERT INTO `tr_recipe_ingredient` VALUES (1,1,'une portion'),(2,1,'3dl');


