-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathinit_data.sql
291 lines (246 loc) · 20.7 KB
/
init_data.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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
create table t_config_settings
(
id int auto_increment
primary key,
created_time datetime default CURRENT_TIMESTAMP null comment '创建时间',
creator_id int default 0 null comment '创建人id',
modified_time datetime default CURRENT_TIMESTAMP null comment '更新时间',
modifier_id int default 0 null comment '修改人id',
is_deleted int default 0 null comment '逻辑删除:0=未删除,1=删除',
name varchar(64) default '' not null comment '参数名称',
`key` varchar(128) not null comment '参数键名',
value varchar(128) not null comment '参数键值',
remark varchar(256) default '' null comment '备注',
status int default 0 null comment '状态 0: 正常 1:停用',
order_num int default 0 null comment '排序',
constraint ix_t_config_settings_name
unique (name)
);
create index ix_t_config_settings_id
on t_config_settings (id);
create table t_dict_data
(
id int auto_increment
primary key,
created_time datetime default CURRENT_TIMESTAMP null comment '创建时间',
creator_id int default 0 null comment '创建人id',
modified_time datetime default CURRENT_TIMESTAMP null comment '更新时间',
modifier_id int default 0 null comment '修改人id',
is_deleted int default 0 null comment '逻辑删除:0=未删除,1=删除',
dict_type varchar(64) not null comment '字典类型',
dict_name varchar(64) default '' null comment '字典名称',
remark varchar(256) default '' null comment '备注',
status int default 0 null comment '状态 0: 正常 1:停用',
order_num int default 0 null comment '排序',
constraint ix_t_dict_data_dict_type
unique (dict_type)
);
create index ix_t_dict_data_id
on t_dict_data (id);
create table t_dict_details
(
id int auto_increment
primary key,
created_time datetime default CURRENT_TIMESTAMP null comment '创建时间',
creator_id int default 0 null comment '创建人id',
modified_time datetime default CURRENT_TIMESTAMP null comment '更新时间',
modifier_id int default 0 null comment '修改人id',
is_deleted int default 0 null comment '逻辑删除:0=未删除,1=删除',
dict_label varchar(128) not null comment '字典标签',
dict_value varchar(128) not null comment '字典键值',
remark varchar(256) default '' null comment '备注',
is_default tinyint(1) default 0 not null comment '是否默认值',
status int default 0 null comment '状态 0: 正常 1:停用',
order_num int default 0 null comment '排序',
dict_data_id int null,
constraint t_dict_details_ibfk_1
foreign key (dict_data_id) references t_dict_data (id)
on delete cascade
);
create index dict_data_id
on t_dict_details (dict_data_id);
create index ix_t_dict_details_id
on t_dict_details (id);
INSERT INTO t_config_settings (id, created_time, creator_id, modified_time, modifier_id, is_deleted, name, `key`, value, remark, status, order_num) VALUES (1, '2022-11-13 02:47:53', 0, '2022-11-13 02:47:53', 0, 0, '用户初始角色', 'user_init_roles', 'general', '0', 0, 1);
INSERT INTO t_dict_data (id, created_time, creator_id, modified_time, modifier_id, is_deleted, dict_type, dict_name, remark, status, order_num) VALUES (1, '2022-11-13 02:49:40', 0, '2022-11-13 02:49:40', 0, 0, 'permission_user_sex', '用户性别', '(0: 未知; 1: 男; 2: 女)', 0, 1);
INSERT INTO t_dict_data (id, created_time, creator_id, modified_time, modifier_id, is_deleted, dict_type, dict_name, remark, status, order_num) VALUES (2, '2022-11-13 02:49:40', 0, '2022-11-13 02:49:40', 0, 0, 'com_default_status', '通用状态字典', '(0: 正常; 1: 停用)', 0, 2);
INSERT INTO t_dict_data (id, created_time, creator_id, modified_time, modifier_id, is_deleted, dict_type, dict_name, remark, status, order_num) VALUES (3, '2022-11-13 02:49:40', 0, '2022-11-13 02:49:40', 0, 0, 'permission_user_status', '用户状态', '', 0, 3);
INSERT INTO t_dict_details (id, created_time, creator_id, modified_time, modifier_id, is_deleted, dict_label, dict_value, remark, is_default, status, order_num, dict_data_id) VALUES (1, '2022-11-13 02:52:55', 0, '2022-11-13 02:52:55', 0, 0, '未知', '0', '', 1, 0, 1, 1);
INSERT INTO t_dict_details (id, created_time, creator_id, modified_time, modifier_id, is_deleted, dict_label, dict_value, remark, is_default, status, order_num, dict_data_id) VALUES (2, '2022-11-13 02:52:55', 0, '2022-11-13 02:52:55', 0, 0, '男', '1', '', 0, 0, 2, 1);
INSERT INTO t_dict_details (id, created_time, creator_id, modified_time, modifier_id, is_deleted, dict_label, dict_value, remark, is_default, status, order_num, dict_data_id) VALUES (3, '2022-11-13 02:52:55', 0, '2022-11-13 02:52:55', 0, 0, '女', '2', '', 0, 0, 3, 1);
INSERT INTO t_dict_details (id, created_time, creator_id, modified_time, modifier_id, is_deleted, dict_label, dict_value, remark, is_default, status, order_num, dict_data_id) VALUES (4, '2022-11-13 02:52:55', 0, '2022-11-13 02:52:55', 0, 0, '正常', '0', '', 1, 0, 0, 2);
INSERT INTO t_dict_details (id, created_time, creator_id, modified_time, modifier_id, is_deleted, dict_label, dict_value, remark, is_default, status, order_num, dict_data_id) VALUES (5, '2022-11-13 02:52:55', 0, '2022-11-13 02:52:55', 0, 0, '停用', '1', '', 0, 0, 1, 2);
INSERT INTO t_dict_details (id, created_time, creator_id, modified_time, modifier_id, is_deleted, dict_label, dict_value, remark, is_default, status, order_num, dict_data_id) VALUES (6, '2022-11-13 02:52:55', 0, '2022-11-13 02:52:55', 0, 0, '正常', '0', '', 1, 0, 1, 3);
INSERT INTO t_dict_details (id, created_time, creator_id, modified_time, modifier_id, is_deleted, dict_label, dict_value, remark, is_default, status, order_num, dict_data_id) VALUES (7, '2022-11-13 02:52:55', 0, '2022-11-13 02:52:55', 0, 0, '停用', '1', '', 0, 0, 2, 3);
INSERT INTO t_dict_details (id, created_time, creator_id, modified_time, modifier_id, is_deleted, dict_label, dict_value, remark, is_default, status, order_num, dict_data_id) VALUES (8, '2022-11-13 02:52:55', 0, '2022-11-13 02:52:55', 0, 0, '拉黑', '2', '', 0, 0, 3, 3);
create table t_roles
(
id int auto_increment
primary key,
created_time datetime default CURRENT_TIMESTAMP null comment '创建时间',
creator_id int default 0 null comment '创建人id',
modified_time datetime default CURRENT_TIMESTAMP null comment '更新时间',
modifier_id int default 0 null comment '修改人id',
is_deleted int default 0 null comment '逻辑删除:0=未删除,1=删除',
`key` varchar(64) not null comment '权限标识',
name varchar(256) default '' null comment '权限名称',
order_num int default 0 null comment '顺序',
status int default 0 null comment '状态(0: 正常, 1: 停用)',
constraint ix_t_roles_key
unique (`key`)
);
create index ix_t_roles_id
on t_roles (id);
INSERT INTO t_roles (id, created_time, creator_id, modified_time, modifier_id, is_deleted, `key`, name, order_num, status) VALUES (1, '2022-11-13 02:44:13', 0, '2022-11-13 02:44:13', 0, 0, 'admin', '超级管理员', 1, 0);
INSERT INTO t_roles (id, created_time, creator_id, modified_time, modifier_id, is_deleted, `key`, name, order_num, status) VALUES (2, '2022-11-13 02:46:33', 0, '2022-11-13 02:46:33', 0, 0, 'general', '一般用户', 2, 0);
INSERT INTO t_roles (id, created_time, creator_id, modified_time, modifier_id, is_deleted, `key`, name, order_num, status) VALUES (3, '2022-11-22 00:55:04', 1, '2022-11-22 00:55:04', 0, 0, 'Operation', '管理员', 3, 0);
create table t_users
(
id int auto_increment
primary key,
created_time datetime default CURRENT_TIMESTAMP null comment '创建时间',
creator_id int default 0 null comment '创建人id',
modified_time datetime default CURRENT_TIMESTAMP null comment '更新时间',
modifier_id int default 0 null comment '修改人id',
is_deleted int default 0 null comment '逻辑删除:0=未删除,1=删除',
username varchar(32) not null comment '用户名',
nickname varchar(32) default '' not null comment '姓名',
sex int default 0 null comment '性别',
phone varchar(32) not null comment '手机号',
email varchar(256) not null comment '邮箱',
hashed_password varchar(128) not null comment '密码',
avatar varchar(128) default '' null comment '头像',
status int default 0 not null comment '状态',
is_active tinyint(1) default 0 null comment '是否已经验证用户',
is_superuser tinyint(1) default 0 null comment '是否超级管理员',
constraint ix_t_users_username
unique (username)
);
create index ix_t_users_id
on t_users (id);
INSERT INTO t_users (id, created_time, creator_id, modified_time, modifier_id, is_deleted, username, nickname, sex, phone, email, hashed_password, avatar, status, is_active, is_superuser) VALUES (1, '2022-11-13 02:58:19', 0, '2022-11-13 02:58:19', 0, 0, 'admin', '', 0, '12345678910', '[email protected]', '$2b$12$nlyWZAzu4C9cgbHV/FE1X.nwBKiGemATgCxikPQEQVznMqBCrDw/e', '', 0, 1, 1);
INSERT INTO t_users (id, created_time, creator_id, modified_time, modifier_id, is_deleted, username, nickname, sex, phone, email, hashed_password, avatar, status, is_active, is_superuser) VALUES (2, '2022-11-22 00:48:34', 0, '2022-11-22 00:55:57', 1, 0, 'opt', 'opt', 0, '12345678911', '[email protected]', '$2b$12$EbJD0X5U0LwAvf5EVvYxZO20Jyv2xLKU1quekOyX3SwhdVepz1RFu', '', 0, 1, 0);
INSERT INTO t_users (id, created_time, creator_id, modified_time, modifier_id, is_deleted, username, nickname, sex, phone, email, hashed_password, avatar, status, is_active, is_superuser) VALUES (3, '2022-11-22 00:50:26', 0, '2022-11-22 00:50:26', 0, 0, 'user', '', 0, '12345678912', '[email protected]', '$2b$12$Wov4niPCoLOeBcRNgGDNhekSZBgB/GAhYs25CLHfJG.me1KbFP0am', '', 0, 1, 0);
create table t_menus
(
id int auto_increment
primary key,
created_time datetime default CURRENT_TIMESTAMP null comment '创建时间',
creator_id int default 0 null comment '创建人id',
modified_time datetime default CURRENT_TIMESTAMP null comment '更新时间',
modifier_id int default 0 null comment '修改人id',
is_deleted int default 0 null comment '逻辑删除:0=未删除,1=删除',
path varchar(128) default '' null comment '路由',
component varchar(128) default '' null comment '组件',
is_frame tinyint(1) default 0 null comment '是否外链',
hidden tinyint(1) default 0 null comment '是否隐藏',
status int default 0 null comment '菜单状态',
order_num int default 0 null comment '显示排序',
name varchar(32) default '' null comment '唯一标识用于页面缓存,否则keep-alive会出问题',
title varchar(32) default '' null comment '标题',
icon varchar(32) default '' null comment '图标',
no_cache tinyint(1) default 0 null comment '是否缓存',
parent_id int default 0 null comment '上级菜单'
);
create index ix_t_menus_id
on t_menus (id);
INSERT INTO t_menus (id, created_time, creator_id, modified_time, modifier_id, is_deleted, path, component, is_frame, hidden, status, order_num, name, title, icon, no_cache, parent_id) VALUES (1, '2022-07-14 03:56:19', 0, '2022-07-19 15:40:51', 0, 0, 'role', '/permission/role/index', 0, 0, 0, 3, 'PermissionRole', '角色管理', 'peoples', 1, 7);
INSERT INTO t_menus (id, created_time, creator_id, modified_time, modifier_id, is_deleted, path, component, is_frame, hidden, status, order_num, name, title, icon, no_cache, parent_id) VALUES (2, '2022-07-14 03:56:19', 0, '2022-07-20 10:25:17', 0, 0, '/system', '', 0, 0, 0, 2, '', '系统管理', 'system', 0, 0);
INSERT INTO t_menus (id, created_time, creator_id, modified_time, modifier_id, is_deleted, path, component, is_frame, hidden, status, order_num, name, title, icon, no_cache, parent_id) VALUES (3, '2022-07-14 03:56:19', 0, '2022-07-19 16:03:40', 0, 0, 'menu', '/permission/menu/index', 0, 0, 0, 2, 'PermissionMenu', '菜单管理', 'tree-table', 0, 7);
INSERT INTO t_menus (id, created_time, creator_id, modified_time, modifier_id, is_deleted, path, component, is_frame, hidden, status, order_num, name, title, icon, no_cache, parent_id) VALUES (4, '2022-07-14 03:56:19', 0, '2022-07-14 03:56:19', 0, 0, 'dict', '/system/dict/index', 0, 0, 0, 4, 'SystemDictType', '字典管理', 'dict', 0, 2);
INSERT INTO t_menus (id, created_time, creator_id, modified_time, modifier_id, is_deleted, path, component, is_frame, hidden, status, order_num, name, title, icon, no_cache, parent_id) VALUES (5, '2022-07-14 03:56:19', 0, '2022-07-14 03:56:19', 0, 0, 'parameter', '/system/parameter/index', 0, 0, 0, 3, 'SystemParameter', '参数管理', 'tree', 0, 2);
INSERT INTO t_menus (id, created_time, creator_id, modified_time, modifier_id, is_deleted, path, component, is_frame, hidden, status, order_num, name, title, icon, no_cache, parent_id) VALUES (6, '2022-07-14 03:56:19', 0, '2022-07-19 16:03:33', 0, 0, 'user', '/permission/user/index', 0, 0, 0, 1, 'PermissionUser', '用户管理', 'user', 0, 7);
INSERT INTO t_menus (id, created_time, creator_id, modified_time, modifier_id, is_deleted, path, component, is_frame, hidden, status, order_num, name, title, icon, no_cache, parent_id) VALUES (7, '2022-07-14 03:56:19', 0, '2022-07-20 10:25:24', 0, 0, '/permission', '', 0, 0, 0, 1, '', '权限管理', 'monitor', 0, 0);
INSERT INTO t_menus (id, created_time, creator_id, modified_time, modifier_id, is_deleted, path, component, is_frame, hidden, status, order_num, name, title, icon, no_cache, parent_id) VALUES (8, '2022-07-14 03:56:19', 0, '2022-07-14 03:56:19', 0, 0, 'dict/detail/:id(\\d+)', '/system/dict/detail/index', 0, 1, 0, 1, 'SystemDictDetail', '字典参数', 'dashboard', 0, 2);
INSERT INTO t_menus (id, created_time, creator_id, modified_time, modifier_id, is_deleted, path, component, is_frame, hidden, status, order_num, name, title, icon, no_cache, parent_id) VALUES (9, '2022-10-29 23:57:16', 0, '2022-10-29 23:57:16', 0, 0, 'label', '/permission/label/index', 0, 0, 0, 4, 'PermissionLabel', '权限标签', 'icon', 1, 7);
create table t_perm_label
(
id int auto_increment
primary key,
created_time datetime default CURRENT_TIMESTAMP null comment '创建时间',
creator_id int default 0 null comment '创建人id',
modified_time datetime default CURRENT_TIMESTAMP null comment '更新时间',
modifier_id int default 0 null comment '修改人id',
is_deleted int default 0 null comment '逻辑删除:0=未删除,1=删除',
label varchar(128) default '' null comment '标签',
remark varchar(256) default '' null comment '备注',
status int default 0 null comment '状态'
);
create index ix_t_perm_label_id
on t_perm_label (id);
create table t_user_role
(
id int auto_increment
primary key,
created_time datetime default CURRENT_TIMESTAMP null comment '创建时间',
creator_id int default 0 null comment '创建人id',
modified_time datetime default CURRENT_TIMESTAMP null comment '更新时间',
modifier_id int default 0 null comment '修改人id',
is_deleted int default 0 null comment '逻辑删除:0=未删除,1=删除',
user_id int null,
role_id int null,
constraint t_user_role_ibfk_1
foreign key (user_id) references t_users (id)
on delete cascade,
constraint t_user_role_ibfk_2
foreign key (role_id) references t_roles (id)
);
create index ix_t_user_role_id
on t_user_role (id);
create index role_id
on t_user_role (role_id);
create index user_id
on t_user_role (user_id);
INSERT INTO t_user_role (id, created_time, creator_id, modified_time, modifier_id, is_deleted, user_id, role_id) VALUES (1, '2022-11-13 02:58:19', 0, '2022-11-13 02:58:19', 0, 0, 1, 1);
INSERT INTO t_user_role (id, created_time, creator_id, modified_time, modifier_id, is_deleted, user_id, role_id) VALUES (3, '2022-11-22 00:50:26', 0, '2022-11-22 00:50:26', 0, 0, 3, 2);
INSERT INTO t_user_role (id, created_time, creator_id, modified_time, modifier_id, is_deleted, user_id, role_id) VALUES (4, '2022-11-22 00:55:57', 1, '2022-11-22 00:55:57', 0, 0, 2, 3);
create table t_role_menu
(
id int auto_increment
primary key,
created_time datetime default CURRENT_TIMESTAMP null comment '创建时间',
creator_id int default 0 null comment '创建人id',
modified_time datetime default CURRENT_TIMESTAMP null comment '更新时间',
modifier_id int default 0 null comment '修改人id',
is_deleted int default 0 null comment '逻辑删除:0=未删除,1=删除',
role_id int null,
menu_id int null,
constraint t_role_menu_ibfk_1
foreign key (role_id) references t_roles (id)
on delete cascade,
constraint t_role_menu_ibfk_2
foreign key (menu_id) references t_menus (id)
);
create index ix_t_role_menu_id
on t_role_menu (id);
create index menu_id
on t_role_menu (menu_id);
create index role_id
on t_role_menu (role_id);
INSERT INTO t_role_menu (id, created_time, creator_id, modified_time, modifier_id, is_deleted, role_id, menu_id) VALUES (1, '2022-11-22 00:55:04', 0, '2022-11-22 00:55:04', 0, 0, 3, 2);
INSERT INTO t_role_menu (id, created_time, creator_id, modified_time, modifier_id, is_deleted, role_id, menu_id) VALUES (2, '2022-11-22 00:55:04', 0, '2022-11-22 00:55:04', 0, 0, 3, 4);
INSERT INTO t_role_menu (id, created_time, creator_id, modified_time, modifier_id, is_deleted, role_id, menu_id) VALUES (3, '2022-11-22 00:55:04', 0, '2022-11-22 00:55:04', 0, 0, 3, 5);
INSERT INTO t_role_menu (id, created_time, creator_id, modified_time, modifier_id, is_deleted, role_id, menu_id) VALUES (4, '2022-11-22 00:55:04', 0, '2022-11-22 00:55:04', 0, 0, 3, 8);
create table t_perm_label_role
(
id int auto_increment
primary key,
created_time datetime default CURRENT_TIMESTAMP null comment '创建时间',
creator_id int default 0 null comment '创建人id',
modified_time datetime default CURRENT_TIMESTAMP null comment '更新时间',
modifier_id int default 0 null comment '修改人id',
is_deleted int default 0 null comment '逻辑删除:0=未删除,1=删除',
label_id int null,
role_id int null,
constraint t_perm_label_role_ibfk_1
foreign key (label_id) references t_perm_label (id)
on delete cascade,
constraint t_perm_label_role_ibfk_2
foreign key (role_id) references t_roles (id)
);
create index ix_t_perm_label_role_id
on t_perm_label_role (id);
create index label_id
on t_perm_label_role (label_id);
create index role_id
on t_perm_label_role (role_id);