-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathdemo.sql
More file actions
40 lines (32 loc) · 1.09 KB
/
demo.sql
File metadata and controls
40 lines (32 loc) · 1.09 KB
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
DROP TABLE IF EXISTS `auth_assignment`;
CREATE TABLE `auth_assignment` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`type` int(11) unsigned NOT NULL,
`user_id` int(11) unsigned NOT NULL,
`created_at` int(11) unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
DROP TABLE IF EXISTS `group`;
CREATE TABLE `group` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
LOCK TABLES `group` WRITE;
INSERT INTO `group` (`id`, `name`)
VALUES
(1,'管理员'),
(2,'用户');
UNLOCK TABLES;
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`username` varchar(255) NOT NULL DEFAULT '',
`auth_key` varchar(32) NOT NULL DEFAULT '',
`password_hash` varchar(128) NOT NULL DEFAULT '',
`group_id` int(11) unsigned NOT NULL,
`status` tinyint(1) unsigned NOT NULL DEFAULT '0',
`created_at` int(11) unsigned NOT NULL,
`updated_at` int(11) unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;