1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
-- -----------------------------------------------------
-- Table `ilmagbl1`.`Article`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `ilmagbl1`.`Article` ;
CREATE TABLE IF NOT EXISTS `ilmagbl1`.`Article` (
`idArticle` INT NOT NULL AUTO_INCREMENT,
`Nom` VARCHAR(45) NOT NULL,
PRIMARY KEY (`idArticle`))
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `ilmagbl1`.`Magasin`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `ilmagbl1`.`Magasin` ;
CREATE TABLE IF NOT EXISTS `ilmagbl1`.`Magasin` (
`idMagasin` INT NOT NULL AUTO_INCREMENT,
`Nom` VARCHAR(45) NOT NULL,
PRIMARY KEY (`idMagasin`))
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `ilmagbl1`.`Stock`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `ilmagbl1`.`Stock` ;
CREATE TABLE IF NOT EXISTS `ilmagbl1`.`Stock` (
`idStock` INT NOT NULL AUTO_INCREMENT,
`idStockArticle` INT NOT NULL,
`idStockMagasin` INT NOT NULL,
`StockValeur` INT NOT NULL,
PRIMARY KEY (`idStock`),
INDEX `fk_article_idx` (`idStockArticle` ASC),
INDEX `fk_magasin_idx` (`idStockMagasin` ASC),
CONSTRAINT `fk_article`
FOREIGN KEY (`idStockArticle`)
REFERENCES `ilmagbl1`.`Article` (`idArticle`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_magasin`
FOREIGN KEY (`idStockMagasin`)
REFERENCES `ilmagbl1`.`Magasin` (`idMagasin`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB; |
Partager