-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdump.sql
64 lines (59 loc) · 2.05 KB
/
dump.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
-- -----------------------------------------------------
-- Schema site_admin
-- -----------------------------------------------------
CREATE SCHEMA IF NOT EXISTS `site_admin` DEFAULT CHARACTER SET utf8 ;
USE `site_admin` ;
-- -----------------------------------------------------
-- Table `site_admin`.`users`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `site_admin`.`users` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(255) NOT NULL,
`email` VARCHAR(255) NOT NULL,
`password` VARCHAR(255) NOT NULL,
`avatar` VARCHAR(255) NOT NULL,
`created` DATETIME NOT NULL,
`updated` VARCHAR(45) NOT NULL,
PRIMARY KEY (`id`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table `site_admin`.`pages`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `site_admin`.`pages` (
`id` INT NOT NULL AUTO_INCREMENT,
`title` VARCHAR(255) NOT NULL,
`url` VARCHAR(255) NOT NULL,
`content` TEXT NOT NULL,
`user_id` INT NOT NULL,
`created` DATETIME NOT NULL,
`updated` DATETIME NOT NULL,
PRIMARY KEY (`id`),
INDEX `user_id_idx` (`user_id` ASC) VISIBLE,
CONSTRAINT `user_id`
FOREIGN KEY (`user_id`)
REFERENCES `site_admin`.`users` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table `site_admin`.`password_recovery`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `site_admin`.`password_recovery` (
`id` INT NOT NULL AUTO_INCREMENT,
`email` VARCHAR(255) NOT NULL,
`hash` VARCHAR(255) NOT NULL,
`user_id` INT NOT NULL,
`status` INT NOT NULL DEFAULT 0,
`created` DATETIME NOT NULL,
`updated` DATETIME NOT NULL,
PRIMARY KEY (`id`),
INDEX `user_id_idx` (`user_id` ASC) VISIBLE,
CONSTRAINT `fk_user_id`
FOREIGN KEY (`user_id`)
REFERENCES `site_admin`.`users` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;