Rename tables
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
insert into t_power_type (id, name)
|
||||
insert into t_s_power_type (id, name)
|
||||
values (1, 'module'),
|
||||
(2, 'menu'),
|
||||
(3, 'func'),
|
||||
(4, 'operation') as new_value
|
||||
on duplicate key update name = new_value.name;
|
||||
|
||||
insert into t_power (id, type_id)
|
||||
insert into t_s_power (id, type_id)
|
||||
values (1000000, 1),
|
||||
(1990000, 2),
|
||||
(1010000, 2),
|
||||
@@ -70,11 +70,11 @@ insert into t_power (id, type_id)
|
||||
as new_value
|
||||
on duplicate key update type_id = new_value.type_id;
|
||||
|
||||
insert into t_module (id, name)
|
||||
insert into t_s_module (id, name)
|
||||
values (1000000, '系统') as new_value
|
||||
on duplicate key update name = new_value.name;
|
||||
on duplicate key update name = new_value.name;
|
||||
|
||||
insert into t_menu (id, name, url, parent_id, module_id)
|
||||
insert into t_s_menu (id, name, url, parent_id, module_id)
|
||||
values (1990000, '系统管理', '/system', null, 1000000),
|
||||
(1010000, '用户管理', '/system/user', 1990000, 1000000),
|
||||
(1020000, '角色管理', '/system/role', 1990000, 1000000),
|
||||
@@ -87,7 +87,7 @@ on duplicate key update name =new_value.name,
|
||||
url =new_value.url,
|
||||
parent_id =new_value.parent_id;
|
||||
|
||||
insert into t_func(id, name, menu_id, parent_id)
|
||||
insert into t_s_func(id, name, menu_id, parent_id)
|
||||
values (1010100, '查询', 1010000, null),
|
||||
(1010200, '增加', 1010000, null),
|
||||
(1010300, '修改', 1010000, null),
|
||||
@@ -109,7 +109,7 @@ on duplicate key update name = new_value.name,
|
||||
menu_id = new_value.menu_id,
|
||||
parent_id = new_value.parent_id;
|
||||
|
||||
insert into t_operation(id, name, code, func_id)
|
||||
insert into t_s_operation(id, name, code, func_id)
|
||||
values (1010101, '单个', 'system:user:query:one', 1010100),
|
||||
(1010102, '全部', 'system:user:query:all', 1010100),
|
||||
(1010103, '列表', 'system:user:query:list', 1010100),
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
drop table if exists t_s_user;
|
||||
|
||||
create table if not exists t_s_user
|
||||
(
|
||||
id bigint not null primary key,
|
||||
username varchar(20) not null comment '用户名',
|
||||
password char(70) not null comment '密码',
|
||||
verify varchar(144) null comment '验证邮箱',
|
||||
forget varchar(144) null comment '忘记密码',
|
||||
locking int not null comment '锁定',
|
||||
expiration datetime comment '过期时间',
|
||||
credentials_expiration datetime comment '认证过期时间',
|
||||
enable int not null comment '启用',
|
||||
current_login_time datetime comment '当前登录时间',
|
||||
current_login_ip varchar(128) comment '当前登录 IP',
|
||||
last_login_time datetime comment '上次登录时间',
|
||||
last_login_ip varchar(128) comment '上次登录 IP',
|
||||
create_time datetime not null default (utc_timestamp()) comment '创建时间',
|
||||
update_time datetime not null default (utc_timestamp()) comment '修改时间',
|
||||
deleted bigint not null default 0,
|
||||
version int not null default 0,
|
||||
constraint t_s_user_unique_username unique (username, deleted),
|
||||
constraint t_s_user_unique_verify unique (verify, deleted),
|
||||
constraint t_s_user_unique_forget unique (forget, deleted)
|
||||
) comment '系统-用户表';
|
||||
@@ -1,25 +0,0 @@
|
||||
drop table if exists t_user;
|
||||
|
||||
create table if not exists t_user
|
||||
(
|
||||
id bigint not null primary key,
|
||||
username varchar(20) not null comment '用户名',
|
||||
password char(70) not null comment '密码',
|
||||
verify varchar(144) null comment '验证邮箱',
|
||||
forget varchar(144) null comment '忘记密码',
|
||||
locking int not null comment '锁定',
|
||||
expiration datetime comment '过期时间',
|
||||
credentials_expiration datetime comment '认证过期时间',
|
||||
enable int not null comment '启用',
|
||||
current_login_time datetime comment '当前登录时间',
|
||||
current_login_ip varchar(128) comment '当前登录 IP',
|
||||
last_login_time datetime comment '上次登录时间',
|
||||
last_login_ip varchar(128) comment '上次登录 IP',
|
||||
create_time datetime not null default (utc_timestamp()) comment '创建时间',
|
||||
update_time datetime not null default (utc_timestamp()) comment '修改时间',
|
||||
deleted bigint not null default 0,
|
||||
version int not null default 0,
|
||||
constraint t_user_unique_username unique (username, deleted),
|
||||
constraint t_user_unique_verify unique (verify, deleted),
|
||||
constraint t_user_unique_forget unique (forget, deleted)
|
||||
) comment '用户表';
|
||||
@@ -1,7 +0,0 @@
|
||||
drop table if exists t_power_type;
|
||||
|
||||
create table if not exists t_power_type
|
||||
(
|
||||
id bigint not null primary key,
|
||||
name varchar(50) not null comment '权限类型名'
|
||||
) comment '权限类型表';
|
||||
@@ -0,0 +1,7 @@
|
||||
drop table if exists t_s_power_type;
|
||||
|
||||
create table if not exists t_s_power_type
|
||||
(
|
||||
id bigint not null primary key,
|
||||
name varchar(50) not null comment '权限类型名'
|
||||
) comment '系统-权限类型表';
|
||||
@@ -1,7 +0,0 @@
|
||||
drop table if exists t_power;
|
||||
|
||||
create table if not exists t_power
|
||||
(
|
||||
id bigint not null primary key,
|
||||
type_id int not null comment '权限类型'
|
||||
) comment '权限表';
|
||||
@@ -0,0 +1,7 @@
|
||||
drop table if exists t_s_power;
|
||||
|
||||
create table if not exists t_s_power
|
||||
(
|
||||
id bigint not null primary key,
|
||||
type_id int not null comment '权限类型'
|
||||
) comment '系统-权限表';
|
||||
@@ -1,10 +1,10 @@
|
||||
drop table if exists t_menu;
|
||||
drop table if exists t_s_menu;
|
||||
|
||||
create table if not exists t_menu
|
||||
create table if not exists t_s_menu
|
||||
(
|
||||
id bigint not null primary key,
|
||||
name varchar(30) not null comment ' 菜单名',
|
||||
url varchar(100) null comment 'URL',
|
||||
parent_id bigint null comment '父ID',
|
||||
module_id bigint not null comment '模块ID'
|
||||
) comment '菜单表';
|
||||
) comment '系统-菜单表';
|
||||
@@ -1,9 +1,9 @@
|
||||
drop table if exists t_func;
|
||||
drop table if exists t_s_func;
|
||||
|
||||
create table if not exists t_func
|
||||
create table if not exists t_s_func
|
||||
(
|
||||
id bigint not null primary key,
|
||||
name varchar(100) not null comment '功能名',
|
||||
parent_id bigint null comment '父ID',
|
||||
menu_id bigint not null comment '菜单ID'
|
||||
) comment '功能表';
|
||||
) comment '系统-功能表';
|
||||
@@ -1,9 +0,0 @@
|
||||
drop table if exists t_operation;
|
||||
|
||||
create table if not exists t_operation
|
||||
(
|
||||
id bigint not null primary key,
|
||||
name varchar(50) not null comment '操作名',
|
||||
code varchar(50) null comment '操作编码',
|
||||
func_id bigint not null comment '功能ID'
|
||||
) comment '操作表';
|
||||
@@ -0,0 +1,9 @@
|
||||
drop table if exists t_s_operation;
|
||||
|
||||
create table if not exists t_s_operation
|
||||
(
|
||||
id bigint not null primary key,
|
||||
name varchar(50) not null comment '操作名',
|
||||
code varchar(50) null comment '操作编码',
|
||||
func_id bigint not null comment '功能ID'
|
||||
) comment '系统-操作表';
|
||||
@@ -1,13 +0,0 @@
|
||||
drop table if exists t_group;
|
||||
|
||||
create table if not exists t_group
|
||||
(
|
||||
id bigint not null primary key,
|
||||
name varchar(30) not null comment '用户组名',
|
||||
enable int not null comment '启用',
|
||||
create_time datetime not null default (utc_timestamp()) comment '创建时间',
|
||||
update_time datetime not null default (utc_timestamp()) comment '修改时间',
|
||||
deleted bigint not null default 0,
|
||||
version int not null default 0,
|
||||
constraint t_group_unique unique (name, deleted)
|
||||
) comment '用户组表';
|
||||
@@ -0,0 +1,13 @@
|
||||
drop table if exists t_s_group;
|
||||
|
||||
create table if not exists t_s_group
|
||||
(
|
||||
id bigint not null primary key,
|
||||
name varchar(30) not null comment '用户组名',
|
||||
enable int not null comment '启用',
|
||||
create_time datetime not null default (utc_timestamp()) comment '创建时间',
|
||||
update_time datetime not null default (utc_timestamp()) comment '修改时间',
|
||||
deleted bigint not null default 0,
|
||||
version int not null default 0,
|
||||
constraint t_s_group_unique unique (name, deleted)
|
||||
) comment '系统-用户组表';
|
||||
@@ -1,10 +1,10 @@
|
||||
drop table if exists t_user_group;
|
||||
drop table if exists t_r_user_group;
|
||||
|
||||
create table if not exists t_user_group
|
||||
create table if not exists t_r_user_group
|
||||
(
|
||||
id bigint not null primary key,
|
||||
user_id bigint not null comment '用户',
|
||||
group_id bigint not null comment '用户组',
|
||||
deleted bigint not null default 0,
|
||||
version int not null default 0
|
||||
) comment '中间表-用户-用户组';
|
||||
) comment '中间表-系统-用户-用户组';
|
||||
@@ -1,13 +0,0 @@
|
||||
drop table if exists t_role;
|
||||
|
||||
create table if not exists t_role
|
||||
(
|
||||
id bigint not null primary key,
|
||||
name varchar(20) not null comment '角色名',
|
||||
enable int not null comment '启用',
|
||||
create_time datetime not null default (utc_timestamp()) comment '创建时间',
|
||||
update_time datetime not null default (utc_timestamp()) comment '修改时间',
|
||||
deleted bigint not null default 0,
|
||||
version int not null default 0,
|
||||
constraint t_role_unique unique (name, deleted)
|
||||
) comment '角色表';
|
||||
@@ -0,0 +1,13 @@
|
||||
drop table if exists t_s_role;
|
||||
|
||||
create table if not exists t_s_role
|
||||
(
|
||||
id bigint not null primary key,
|
||||
name varchar(20) not null comment '角色名',
|
||||
enable int not null comment '启用',
|
||||
create_time datetime not null default (utc_timestamp()) comment '创建时间',
|
||||
update_time datetime not null default (utc_timestamp()) comment '修改时间',
|
||||
deleted bigint not null default 0,
|
||||
version int not null default 0,
|
||||
constraint t_s_role_unique unique (name, deleted)
|
||||
) comment '系统-角色表';
|
||||
@@ -1,10 +1,10 @@
|
||||
drop table if exists t_role_group;
|
||||
drop table if exists t_r_role_group;
|
||||
|
||||
create table if not exists t_role_group
|
||||
create table if not exists t_r_role_group
|
||||
(
|
||||
id bigint not null primary key,
|
||||
role_id bigint not null comment '角色',
|
||||
group_id bigint not null comment '用户组',
|
||||
deleted bigint not null default 0,
|
||||
version int not null default 0
|
||||
) comment '中间表-角色-用户组';
|
||||
) comment '中间表-系统-角色-用户组';
|
||||
@@ -1,10 +1,10 @@
|
||||
drop table if exists t_user_role;
|
||||
drop table if exists t_r_user_role;
|
||||
|
||||
create table if not exists t_user_role
|
||||
create table if not exists t_r_user_role
|
||||
(
|
||||
id bigint not null primary key,
|
||||
user_id bigint not null comment '用户',
|
||||
role_id bigint not null comment '角色',
|
||||
deleted bigint not null default 0,
|
||||
version int not null default 0
|
||||
) comment '中间表-用户-角色';
|
||||
) comment '中间表-系统-用户-角色';
|
||||
@@ -1,10 +1,10 @@
|
||||
drop table if exists t_power_role;
|
||||
drop table if exists t_r_power_role;
|
||||
|
||||
create table if not exists t_power_role
|
||||
create table if not exists t_r_power_role
|
||||
(
|
||||
id bigint not null primary key,
|
||||
power_id bigint not null comment '权限',
|
||||
role_id bigint not null comment '角色',
|
||||
deleted bigint not null default 0,
|
||||
version int not null default 0
|
||||
) comment '中间表-权限-角色';
|
||||
) comment '中间表-系统-权限-角色';
|
||||
@@ -1,7 +0,0 @@
|
||||
drop table if exists t_module;
|
||||
|
||||
create table if not exists t_module
|
||||
(
|
||||
id bigint not null primary key,
|
||||
name varchar(100) not null comment '模块名'
|
||||
) comment '模块表';
|
||||
@@ -0,0 +1,7 @@
|
||||
drop table if exists t_s_module;
|
||||
|
||||
create table if not exists t_s_module
|
||||
(
|
||||
id bigint not null primary key,
|
||||
name varchar(100) not null comment '模块名'
|
||||
) comment '系统-模块表';
|
||||
@@ -1,6 +1,6 @@
|
||||
drop table if exists t_user_info;
|
||||
drop table if exists t_s_user_info;
|
||||
|
||||
create table if not exists t_user_info
|
||||
create table if not exists t_s_user_info
|
||||
(
|
||||
id bigint not null primary key,
|
||||
user_id bigint not null comment '用户ID',
|
||||
@@ -11,6 +11,6 @@ create table if not exists t_user_info
|
||||
update_time datetime not null default (utc_timestamp()) comment '修改时间',
|
||||
deleted bigint not null default 0,
|
||||
version int not null default 0,
|
||||
constraint t_user_info_unique_user_id unique (user_id, deleted),
|
||||
constraint t_user_info_unique_email unique (email, deleted)
|
||||
) comment '用户资料表';
|
||||
constraint t_s_user_info_unique_user_id unique (user_id, deleted),
|
||||
constraint t_s_user_info_unique_email unique (email, deleted)
|
||||
) comment '系统-用户资料表';
|
||||
@@ -0,0 +1,12 @@
|
||||
drop table if exists t_s_sensitive_word;
|
||||
|
||||
create table if not exists t_s_sensitive_word
|
||||
(
|
||||
id bigint not null primary key,
|
||||
word varchar(400) not null comment '词',
|
||||
use_for varchar(50) null comment '用于',
|
||||
enable int not null default 1 comment '启用',
|
||||
deleted bigint not null default 0,
|
||||
version int not null default 0,
|
||||
constraint t_s_sensitive_word_unique_word unique (word, deleted)
|
||||
) comment '系统-敏感词表';
|
||||
@@ -1,6 +1,6 @@
|
||||
drop table if exists t_sys_log;
|
||||
drop table if exists t_l_sys_log;
|
||||
|
||||
create table t_sys_log -- 系统日志表
|
||||
create table t_l_sys_log -- 本地-系统日志表
|
||||
(
|
||||
id integer not null,
|
||||
log_type text not null, -- 日志类型
|
||||
@@ -1,6 +1,6 @@
|
||||
drop table if exists t_event_log;
|
||||
drop table if exists t_l_event_log;
|
||||
|
||||
create table if not exists t_event_log -- 事件日志表
|
||||
create table if not exists t_l_event_log -- 本地-事件日志表
|
||||
(
|
||||
id integer not null primary key,
|
||||
event text not null, -- 事件,
|
||||
@@ -1,6 +1,6 @@
|
||||
drop table if exists t_statistics_log;
|
||||
drop table if exists t_l_statistics_log;
|
||||
|
||||
create table if not exists t_statistics_log -- 统计日志表
|
||||
create table if not exists t_l_statistics_log -- 本地-统计日志表
|
||||
(
|
||||
id integer not null primary key,
|
||||
key text not null, -- 记录键
|
||||
@@ -1,9 +0,0 @@
|
||||
drop table if exists t_sensitive_word;
|
||||
|
||||
create table if not exists t_sensitive_word -- 敏感词表
|
||||
(
|
||||
id integer not null primary key,
|
||||
word text not null unique, -- 词
|
||||
use_for text null, -- 用于
|
||||
enable integer not null default 1 -- 启用
|
||||
);
|
||||
Reference in New Issue
Block a user