-
Notifications
You must be signed in to change notification settings - Fork 3
/
sql.sql
100 lines (86 loc) · 3.53 KB
/
sql.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
88
89
90
91
92
93
94
95
96
97
98
99
100
-- 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 cafesystem
-- -----------------------------------------------------
-- -----------------------------------------------------
-- Schema cafesystem
-- -----------------------------------------------------
CREATE SCHEMA IF NOT EXISTS `cafesystem` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci ;
USE `cafesystem` ;
-- -----------------------------------------------------
-- Table `cafesystem`.`bill`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `cafesystem`.`bill` (
`id` INT NOT NULL,
`contactnumber` VARCHAR(255) NULL DEFAULT NULL,
`createdby` VARCHAR(255) NULL DEFAULT NULL,
`email` VARCHAR(255) NULL DEFAULT NULL,
`name` VARCHAR(255) NULL DEFAULT NULL,
`paymentmethod` VARCHAR(255) NULL DEFAULT NULL,
`productdetails` JSON NULL DEFAULT NULL,
`total` INT NULL DEFAULT NULL,
`uuid` VARCHAR(255) NULL DEFAULT NULL,
PRIMARY KEY (`id`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci;
-- -----------------------------------------------------
-- Table `cafesystem`.`category`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `cafesystem`.`category` (
`id` INT NOT NULL,
`name` VARCHAR(255) NULL DEFAULT NULL,
PRIMARY KEY (`id`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci;
-- -----------------------------------------------------
-- Table `cafesystem`.`hibernate_sequence`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `cafesystem`.`hibernate_sequence` (
`next_val` BIGINT NULL DEFAULT NULL)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci;
-- -----------------------------------------------------
-- Table `cafesystem`.`product`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `cafesystem`.`product` (
`id` INT NOT NULL,
`description` VARCHAR(255) NULL DEFAULT NULL,
`status` VARCHAR(255) NULL DEFAULT NULL,
`name` VARCHAR(255) NULL DEFAULT NULL,
`price` INT NULL DEFAULT NULL,
`category_fk` INT NOT NULL,
PRIMARY KEY (`id`),
INDEX `FK275nu1ncohhfur6qhxiwrm3go` (`category_fk` ASC) VISIBLE,
CONSTRAINT `FK275nu1ncohhfur6qhxiwrm3go`
FOREIGN KEY (`category_fk`)
REFERENCES `cafesystem`.`category` (`id`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci;
-- -----------------------------------------------------
-- Table `cafesystem`.`user`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `cafesystem`.`user` (
`id` INT NOT NULL,
`contact_number` VARCHAR(255) NULL DEFAULT NULL,
`email` VARCHAR(255) NULL DEFAULT NULL,
`name` VARCHAR(255) NULL DEFAULT NULL,
`password` VARCHAR(255) NULL DEFAULT NULL,
`role` VARCHAR(255) NULL DEFAULT NULL,
`status` VARCHAR(255) NULL DEFAULT NULL,
PRIMARY KEY (`id`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;