-
Notifications
You must be signed in to change notification settings - Fork 5
/
schema.sql
87 lines (77 loc) · 3.28 KB
/
schema.sql
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
-- -- MySQL Workbench Forward Engineering
-- SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
-- SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
-- SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';
-- -- -----------------------------------------------------
-- -- Schema mydb
-- -- -----------------------------------------------------
-- -- -----------------------------------------------------
-- -- Schema depot
-- -- -----------------------------------------------------
-- -- -----------------------------------------------------
-- -- Schema depot
-- -- -----------------------------------------------------
-- CREATE SCHEMA IF NOT EXISTS `depot` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci ;
-- USE `depot` ;
-- -- -----------------------------------------------------
-- -- Table `depot`.`fournisseur`
-- -- -----------------------------------------------------
-- CREATE TABLE IF NOT EXISTS `depot`.`fournisseur` (
-- `id` INT NOT NULL AUTO_INCREMENT,
-- `CompanyName` VARCHAR(45) NOT NULL,
-- `manager` VARCHAR(45) NULL DEFAULT NULL,
-- `email` VARCHAR(255) NOT NULL,
-- `password` VARCHAR(45) NOT NULL,
-- `image` LONGTEXT NULL DEFAULT NULL,
-- `adress` VARCHAR(255) NULL DEFAULT NULL,
-- `phoneNumber` INT NULL DEFAULT NULL,
-- PRIMARY KEY (`id`),
-- UNIQUE INDEX `id_UNIQUE` (`id` ASC) VISIBLE)
-- ENGINE = InnoDB
-- DEFAULT CHARACTER SET = utf8mb4
-- COLLATE = utf8mb4_0900_ai_ci;
-- -- -----------------------------------------------------
-- -- Table `depot`.`user`
-- -- -----------------------------------------------------
-- CREATE TABLE IF NOT EXISTS `depot`.`user` (
-- `id` INT NOT NULL AUTO_INCREMENT,
-- `name` VARCHAR(45) NOT NULL,
-- `email` VARCHAR(255) NOT NULL,
-- `password` VARCHAR(45) NULL DEFAULT NULL,
-- `adress` VARCHAR(255) NOT NULL,
-- `phoneNumber` INT NULL DEFAULT NULL,
-- PRIMARY KEY (`id`))
-- ENGINE = InnoDB
-- DEFAULT CHARACTER SET = utf8mb4
-- COLLATE = utf8mb4_0900_ai_ci;
-- -- -----------------------------------------------------
-- -- Table `depot`.`product`
-- -- -----------------------------------------------------
-- CREATE TABLE IF NOT EXISTS `depot`.`product` (
-- `id` INT NOT NULL AUTO_INCREMENT,
-- `name` VARCHAR(45) NOT NULL,
-- `quantity` INT NOT NULL,
-- `description` VARCHAR(255) NULL DEFAULT NULL,
-- `price` INT NULL DEFAULT NULL,
-- `image` LONGTEXT NULL DEFAULT NULL,
-- `user_id` INT NOT NULL,
-- `fournisseur_id` INT NOT NULL,
-- PRIMARY KEY (`id`, `user_id`, `fournisseur_id`),
-- INDEX `fk_product_user_idx` (`user_id` ASC) VISIBLE,
-- INDEX `fk_product_fournisseur1_idx` (`fournisseur_id` ASC) VISIBLE,
-- CONSTRAINT `fk_product_user`
-- FOREIGN KEY (`user_id`)
-- REFERENCES `depot`.`user` (`id`)
-- ON DELETE NO ACTION
-- ON UPDATE NO ACTION,
-- CONSTRAINT `fk_product_fournisseur1`
-- FOREIGN KEY (`fournisseur_id`)
-- REFERENCES `depot`.`fournisseur` (`id`)
-- ON DELETE NO ACTION
-- ON UPDATE NO ACTION)
-- ENGINE = InnoDB
-- DEFAULT CHARACTER SET = utf8mb4
-- COLLATE = utf8mb4_0900_ai_ci;