-
Notifications
You must be signed in to change notification settings - Fork 0
/
db.sql
71 lines (61 loc) · 2.66 KB
/
db.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
-- 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 uni
-- -----------------------------------------------------
-- -----------------------------------------------------
-- Schema uni
-- -----------------------------------------------------
CREATE SCHEMA IF NOT EXISTS `uni` DEFAULT CHARACTER SET utf8 ;
USE `uni` ;
-- -----------------------------------------------------
-- Table `uni`.`asesors`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `uni`.`asesors` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`name` VARCHAR(270) NULL DEFAULT NULL,
`lastname` VARCHAR(270) NULL DEFAULT NULL,
`email` VARCHAR(170) NULL DEFAULT NULL,
`cip` VARCHAR(120) NULL DEFAULT NULL,
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table `uni`.`chats`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `uni`.`chats` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`author` VARCHAR(170) NULL DEFAULT NULL,
`phone` VARCHAR(120) NULL DEFAULT NULL,
`createdAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`status` VARCHAR(45) NULL DEFAULT 'talking',
PRIMARY KEY (`id`))
ENGINE = InnoDB
AUTO_INCREMENT = 6
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table `uni`.`messages`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `uni`.`messages` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`message` VARCHAR(270) NULL DEFAULT NULL,
`chatID` INT(11) NULL DEFAULT NULL,
`type` VARCHAR(20) NULL DEFAULT NULL,
`author` VARCHAR(170) NULL DEFAULT NULL,
`createdAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`))
ENGINE = InnoDB
AUTO_INCREMENT = 35
DEFAULT CHARACTER SET = utf8;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;