-
Notifications
You must be signed in to change notification settings - Fork 0
/
db.sql
155 lines (137 loc) · 5.62 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
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
/*
Navicat MySQL Data Transfer
Source Server : docker-dev-mysql
Source Server Version : 50726
Source Host : localhost:3306
Source Database : demo
Target Server Type : MYSQL
Target Server Version : 50726
File Encoding : 65001
Date: 2019-08-01 11:53:51
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for hibernate_sequence
-- ----------------------------
DROP TABLE IF EXISTS `hibernate_sequence`;
CREATE TABLE `hibernate_sequence` (
`next_val` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of hibernate_sequence
-- ----------------------------
INSERT INTO `hibernate_sequence` VALUES ('36');
INSERT INTO `hibernate_sequence` VALUES ('36');
INSERT INTO `hibernate_sequence` VALUES ('36');
INSERT INTO `hibernate_sequence` VALUES ('36');
INSERT INTO `hibernate_sequence` VALUES ('36');
-- ----------------------------
-- Table structure for permission
-- ----------------------------
DROP TABLE IF EXISTS `permission`;
CREATE TABLE `permission` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号',
`permission` varchar(100) DEFAULT NULL COMMENT '权限编号',
`description` varchar(100) DEFAULT NULL COMMENT '权限描述',
`rid` bigint(20) DEFAULT NULL COMMENT '此权限关联角色的id',
`available` tinyint(1) DEFAULT '0' COMMENT '是否锁定',
PRIMARY KEY (`id`),
UNIQUE KEY `idx_permission_permission` (`permission`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of permission
-- ----------------------------
INSERT INTO `permission` VALUES ('1', 'user:create', '用户创建', '0', '0');
INSERT INTO `permission` VALUES ('2', 'user:delete', '用户删除', '0', '0');
-- ----------------------------
-- Table structure for request_map
-- ----------------------------
DROP TABLE IF EXISTS `request_map`;
CREATE TABLE `request_map` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`version` bigint(20) NOT NULL,
`config_attribute` varchar(255) NOT NULL,
`url` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of request_map
-- ----------------------------
INSERT INTO `request_map` VALUES ('1', '0', 'authc', '/stomp/**');
INSERT INTO `request_map` VALUES ('2', '0', 'authc', '/websocket/**');
-- ----------------------------
-- Table structure for role
-- ----------------------------
DROP TABLE IF EXISTS `role`;
CREATE TABLE `role` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`pid` bigint(20) DEFAULT NULL,
`role` varchar(255) NOT NULL,
`available` tinyint(1) DEFAULT NULL,
`description` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `UK_irsamgnera6angm0prq1kemt2` (`available`),
KEY `FKqlep3sgoeiptogcc6mkaopwg0` (`pid`),
CONSTRAINT `FKqlep3sgoeiptogcc6mkaopwg0` FOREIGN KEY (`pid`) REFERENCES `role` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of role
-- ----------------------------
INSERT INTO `role` VALUES ('1', null, 'admin', null, '管理员');
INSERT INTO `role` VALUES ('2', '1', 'user', null, '普通用户');
-- ----------------------------
-- Table structure for role_permission
-- ----------------------------
DROP TABLE IF EXISTS `role_permission`;
CREATE TABLE `role_permission` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号',
`role_id` bigint(20) DEFAULT NULL COMMENT '角色编号',
`permission_id` bigint(20) DEFAULT NULL COMMENT '权限编号',
PRIMARY KEY (`id`),
KEY `FKf8yllw1ecvwqy3ehyxawqa1qp` (`permission_id`),
KEY `FKa6jx8n8xkesmjmv6jqug6bg68` (`role_id`),
CONSTRAINT `FKa6jx8n8xkesmjmv6jqug6bg68` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`),
CONSTRAINT `FKf8yllw1ecvwqy3ehyxawqa1qp` FOREIGN KEY (`permission_id`) REFERENCES `permission` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of role_permission
-- ----------------------------
INSERT INTO `role_permission` VALUES ('1', '1', '1');
INSERT INTO `role_permission` VALUES ('2', '2', '2');
-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`username` varchar(255) NOT NULL,
`account_locked` tinyint(1) NOT NULL,
`password` varchar(255) NOT NULL,
`last_login` datetime DEFAULT NULL,
`salt` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `UK_sb8bbouer5wak8vyiiy4pf2bx` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of user
-- ----------------------------
INSERT INTO `user` VALUES ('3', '333', '0', '1aadb8f102577db8546a5c52f654aa89', null, '8542940f371d8f91ee4ea6dc7e36bc17');
INSERT INTO `user` VALUES ('34', '111', '0', 'ddb73e9a6c79ec96117d1474f68f2249', null, 'ee7ef5b5bfaf2307d15cc5e7fbf5ea96');
-- ----------------------------
-- Table structure for user_role
-- ----------------------------
DROP TABLE IF EXISTS `user_role`;
CREATE TABLE `user_role` (
`user_id` bigint(20) NOT NULL,
`role_id` bigint(20) NOT NULL,
`id` bigint(20) NOT NULL,
PRIMARY KEY (`user_id`,`role_id`),
KEY `FKa68196081fvovjhkek5m97n3y` (`role_id`),
CONSTRAINT `FK859n2jvi8ivhui0rl0esws6o` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`),
CONSTRAINT `FKa68196081fvovjhkek5m97n3y` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of user_role
-- ----------------------------
INSERT INTO `user_role` VALUES ('3', '2', '1');
INSERT INTO `user_role` VALUES ('34', '1', '2');