merge 合并5.x分支代码

This commit is contained in:
gssong
2023-07-29 13:41:38 +08:00
370 changed files with 9390 additions and 41015 deletions

View File

@@ -1,3 +1,71 @@
-- ----------------------------
-- 第三方平台授权表
-- ----------------------------
create table sys_social
(
id int8 not null,
user_id int8 not null,
tenant_id varchar(20) default null::varchar,
auth_id varchar(255) not null,
source varchar(255) not null,
open_id varchar(255) default null::varchar,
user_name varchar(30) not null,
nick_name varchar(30) default ''::varchar,
email varchar(255) default ''::varchar,
avatar varchar(500) default ''::varchar,
access_token varchar(255) not null,
expire_in int8 default null,
refresh_token varchar(255) default null::varchar,
access_code varchar(255) default null::varchar,
union_id varchar(255) default null::varchar,
scope varchar(255) default null::varchar,
token_type varchar(255) default null::varchar,
id_token varchar(255) default null::varchar,
mac_algorithm varchar(255) default null::varchar,
mac_key varchar(255) default null::varchar,
code varchar(255) default null::varchar,
oauth_token varchar(255) default null::varchar,
oauth_token_secret varchar(255) default null::varchar,
create_dept int8,
create_by int8,
create_time timestamp,
update_by int8,
update_time timestamp,
del_flag char default '0'::bpchar,
constraint "pk_sys_social" primary key (id)
);
comment on table sys_social is '社会化关系表';
comment on column sys_social.id is '主键';
comment on column sys_social.user_id is '用户ID';
comment on column sys_social.tenant_id is '租户id';
comment on column sys_social.auth_id is '平台+平台唯一id';
comment on column sys_social.source is '用户来源';
comment on column sys_social.open_id is '平台编号唯一id';
comment on column sys_social.user_name is '登录账号';
comment on column sys_social.nick_name is '用户昵称';
comment on column sys_social.email is '用户邮箱';
comment on column sys_social.avatar is '头像地址';
comment on column sys_social.access_token is '用户的授权令牌';
comment on column sys_social.expire_in is '用户的授权令牌的有效期,部分平台可能没有';
comment on column sys_social.refresh_token is '刷新令牌,部分平台可能没有';
comment on column sys_social.access_code is '平台的授权信息,部分平台可能没有';
comment on column sys_social.union_id is '用户的 unionid';
comment on column sys_social.scope is '授予的权限,部分平台可能没有';
comment on column sys_social.token_type is '个别平台的授权信息,部分平台可能没有';
comment on column sys_social.id_token is 'id token部分平台可能没有';
comment on column sys_social.mac_algorithm is '小米平台用户的附带属性,部分平台可能没有';
comment on column sys_social.mac_key is '小米平台用户的附带属性,部分平台可能没有';
comment on column sys_social.code is '用户的授权code部分平台可能没有';
comment on column sys_social.oauth_token is 'Twitter平台用户的附带属性部分平台可能没有';
comment on column sys_social.oauth_token_secret is 'Twitter平台用户的附带属性部分平台可能没有';
comment on column sys_social.create_dept is '创建部门';
comment on column sys_social.create_by is '创建者';
comment on column sys_social.create_time is '创建时间';
comment on column sys_social.update_by is '更新者';
comment on column sys_social.update_time is '更新时间';
comment on column sys_social.del_flag is '删除标志0代表存在 2代表删除';
-- ----------------------------
-- 租户表
-- ----------------------------
@@ -379,14 +447,15 @@ insert into sys_menu values('113', '缓存监控', '2', '5', 'cache',
insert into sys_menu values('114', '表单构建', '3', '1', 'build', 'tool/build/index', '', '1', '0', 'C', '0', '0', 'tool:build:list', 'build', 103, 1, now(), null, null, '表单构建菜单');
insert into sys_menu values('115', '代码生成', '3', '2', 'gen', 'tool/gen/index', '', '1', '0', 'C', '0', '0', 'tool:gen:list', 'code', 103, 1, now(), null, null, '代码生成菜单');
insert into sys_menu values('121', '租户管理', '6', '1', 'tenant', 'system/tenant/index', '', '1', '0', 'C', '0', '0', 'system:tenant:list', 'list', 103, 1, now(), null, null, '租户管理菜单');
insert into sys_menu values('122', '租户套餐管理', '6', '2', 'tenantPackage', 'system/tenantPackage/index', '', '1', '0', 'C', '0', '0', 'system:tenantPackage:list', 'form', 103, 1, now(), null, null, '租户套餐管理菜单');
insert into sys_menu values('122', '租户套餐管理', '6', '2', 'tenantPackage', 'system/tenantPackage/index', '', '1', '0', 'C', '0', '0', 'system:tenantPackage:list', 'form', 103, 1, now(), null, null, '租户套餐管理菜单');
insert into sys_menu values('123', '客户端管理', '1', '11', 'client', 'system/client/index', '', '1', '0', 'C', '0', '0', 'system:client:list', 'international', 103, 1, now(), null, null, '客户端管理菜单');
-- springboot-admin监控
insert into sys_menu values('117', 'Admin监控', '2', '5', 'Admin', 'monitor/admin/index', '', '1', '0', 'C', '0', '0', 'monitor:admin:list', 'dashboard', 103, 1, now(), null, null, 'Admin监控菜单');
-- oss菜单
insert into sys_menu values('118', '文件管理', '1', '10', 'oss', 'system/oss/index', '', '1', '0', 'C', '0', '0', 'system:oss:list', 'upload', 103, 1, now(), null, null, '文件管理菜单');
-- xxl-job-admin控制台
insert into sys_menu values('120', '任务调度中心', '2', '5', 'XxlJob', 'monitor/xxljob/index', '', '1', '0', 'C', '0', '0', 'monitor:xxljob:list', 'job', 103, 1, now(), null, null, 'Xxl-Job控制台菜单');
-- powerjob server控制台
insert into sys_menu values('120', '任务调度中心', '2', '5', 'powerjob', 'monitor/powerjob/index', '', '1', '0', 'C', '0', '0', 'monitor:powerjob:list', 'job', 103, 1, now(), null, null, 'PowerJob控制台菜单');
-- 三级菜单
insert into sys_menu values('500', '操作日志', '108', '1', 'operlog', 'monitor/operlog/index', '', '1', '0', 'C', '0', '0', 'monitor:operlog:list', 'form', 103, 1, now(), null, null, '操作日志菜单');
@@ -477,7 +546,12 @@ insert into sys_menu values('1612', '租户套餐新增', '122', '2', '#', '', '
insert into sys_menu values('1613', '租户套餐修改', '122', '3', '#', '', '', '1', '0', 'F', '0', '0', 'system:tenantPackage:edit', '#', 103, 1, now(), null, null, '');
insert into sys_menu values('1614', '租户套餐删除', '122', '4', '#', '', '', '1', '0', 'F', '0', '0', 'system:tenantPackage:remove', '#', 103, 1, now(), null, null, '');
insert into sys_menu values('1615', '租户套餐导出', '122', '5', '#', '', '', '1', '0', 'F', '0', '0', 'system:tenantPackage:export', '#', 103, 1, now(), null, null, '');
-- 客户端管理按钮
insert into sys_menu values('1061', '客户端管理查询', '123', '1', '#', '', '', '1', '0', 'F', '0', '0', 'system:client:query', '#', 103, 1, now(), null, null, '');
insert into sys_menu values('1062', '客户端管理新增', '123', '2', '#', '', '', '1', '0', 'F', '0', '0', 'system:client:add', '#', 103, 1, now(), null, null, '');
insert into sys_menu values('1063', '客户端管理修改', '123', '3', '#', '', '', '1', '0', 'F', '0', '0', 'system:client:edit', '#', 103, 1, now(), null, null, '');
insert into sys_menu values('1064', '客户端管理删除', '123', '4', '#', '', '', '1', '0', 'F', '0', '0', 'system:client:remove', '#', 103, 1, now(), null, null, '');
insert into sys_menu values('1065', '客户端管理导出', '123', '5', '#', '', '', '1', '0', 'F', '0', '0', 'system:client:export', '#', 103, 1, now(), null, null, '');
-- ----------------------------
-- 6、用户和角色关联表 用户N-1角色
@@ -598,6 +672,11 @@ insert into sys_role_menu values ('2', '1057');
insert into sys_role_menu values ('2', '1058');
insert into sys_role_menu values ('2', '1059');
insert into sys_role_menu values ('2', '1060');
insert into sys_role_menu values ('2', '1061');
insert into sys_role_menu values ('2', '1062');
insert into sys_role_menu values ('2', '1063');
insert into sys_role_menu values ('2', '1064');
insert into sys_role_menu values ('2', '1065');
-- ----------------------------
-- 8、角色和部门关联表 角色1-N部门
@@ -737,8 +816,9 @@ insert into sys_dict_type values(6, '000000', '系统是否', 'sys_yes_no',
insert into sys_dict_type values(7, '000000', '通知类型', 'sys_notice_type', '0', 103, 1, now(), null, null, '通知类型列表');
insert into sys_dict_type values(8, '000000', '通知状态', 'sys_notice_status', '0', 103, 1, now(), null, null, '通知状态列表');
insert into sys_dict_type values(9, '000000', '操作类型', 'sys_oper_type', '0', 103, 1, now(), null, null, '操作类型列表');
insert into sys_dict_type values(10, '000000', '系统状态', 'sys_common_status', '0', 103, 1, now(), null, null, '登录状态列表');
insert into sys_dict_type values(10, '000000', '系统状态', 'sys_common_status', '0', 103, 1, now(), null, null, '登录状态列表');
insert into sys_dict_type values(11, '000000', '授权类型', 'sys_grant_type', '0', 103, 1, now(), null, null, '认证授权类型');
insert into sys_dict_type values(12, '000000', '设备类型', 'sys_device_type', '0', 103, 1, now(), null, null, '客户端设备类型');
-- ----------------------------
-- 12、字典数据表
@@ -808,6 +888,13 @@ insert into sys_dict_data values(25, '000000', 8, '生成代码', '8', 's
insert into sys_dict_data values(26, '000000', 9, '清空数据', '9', 'sys_oper_type', '', 'danger', 'N', '0', 103, 1, now(), null, null, '清空操作');
insert into sys_dict_data values(27, '000000', 1, '成功', '0', 'sys_common_status', '', 'primary', 'N', '0', 103, 1, now(), null, null, '正常状态');
insert into sys_dict_data values(28, '000000', 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', '0', 103, 1, now(), null, null, '停用状态');
insert into sys_dict_data values(30, '000000', 0, '密码认证', 'password', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, now(), null, null, '密码认证');
insert into sys_dict_data values(31, '000000', 0, '短信认证', 'sms', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, now(), null, null, '短信认证');
insert into sys_dict_data values(32, '000000', 0, '邮件认证', 'email', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, now(), null, null, '邮件认证');
insert into sys_dict_data values(33, '000000', 0, '小程序认证', 'xcx', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, now(), null, null, '小程序认证');
insert into sys_dict_data values(34, '000000', 0, '三方登录认证', 'social', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, now(), null, null, '三方登录认证');
insert into sys_dict_data values(35, '000000', 0, 'PC端', 'pc', 'sys_device_type', '', 'default', 'N', '0', 103, 1, now(), null, null, 'PC端');
insert into sys_dict_data values(36, '000000', 0, 'APP端', 'app', 'sys_device_type', '', 'default', 'N', '0', 103, 1, now(), null, null, 'APP端');
-- ----------------------------
@@ -935,6 +1022,7 @@ drop table if exists gen_table;
create table if not exists gen_table
(
table_id int8,
data_name varchar(200) default ''::varchar,
table_name varchar(200) default ''::varchar,
table_comment varchar(500) default ''::varchar,
sub_table_name varchar(64) default ''::varchar,
@@ -960,6 +1048,7 @@ create table if not exists gen_table
comment on table gen_table is '代码生成业务表';
comment on column gen_table.table_id is '编号';
comment on column gen_table.data_name is '数据源名称';
comment on column gen_table.table_name is '表名称';
comment on column gen_table.table_comment is '表描述';
comment on column gen_table.sub_table_name is '关联子表的表名';
@@ -1160,6 +1249,48 @@ comment on column bpmn_form.update_by is '更新者';
comment on column bpmn_form.update_time is '更新时间';
comment on column bpmn_form.remark is '备注';
comment on column bpmn_form.del_flag is '删除标志0代表存在 2代表删除';
-- ----------------------------
-- 系统授权表
-- ----------------------------
drop table if exists sys_client;
create table sys_client (
id int8,
client_id varchar(64) default ''::varchar,
client_key varchar(32) default ''::varchar,
client_secret varchar(255) default ''::varchar,
grant_type varchar(255) default ''::varchar,
device_type varchar(32) default ''::varchar,
active_timeout int4 default 1800,
timeout int4 default 604800,
status char(1) default '0'::bpchar,
del_flag char(1) default '0'::bpchar,
create_dept int8,
create_by int8,
create_time timestamp,
update_by int8,
update_time timestamp,
constraint sys_client_pk primary key (id)
);
comment on table sys_client is '系统授权表';
comment on column sys_client.id is '主建';
comment on column sys_client.client_id is '客户端id';
comment on column sys_client.client_key is '客户端key';
comment on column sys_client.client_secret is '客户端秘钥';
comment on column sys_client.grant_type is '授权类型';
comment on column sys_client.device_type is '设备类型';
comment on column sys_client.active_timeout is 'token活跃超时时间';
comment on column sys_client.timeout is 'token固定超时';
comment on column sys_client.status is '状态0正常 1停用';
comment on column sys_client.del_flag is '删除标志0代表存在 2代表删除';
comment on column sys_client.create_dept is '创建部门';
comment on column sys_client.create_by is '创建者';
comment on column sys_client.create_time is '创建时间';
comment on column sys_client.update_by is '更新者';
comment on column sys_client.update_time is '更新时间';
insert into sys_client values (1, 'e5cd7e4891bf95d1d19206ce24a7b32e', 'pc', 'pc123', 'password,social', 'pc', 1800, 604800, 0, 0, 103, 1, now(), 1, now());
insert into sys_client values (2, '428a8310cd442757ae699df5d894f051', 'app', 'app123', 'password,sms,social', 'app', 1800, 604800, 0, 0, 103, 1, now(), 1, now());
-- 字符串自动转时间 避免框架时间查询报错问题
create or replace function cast_varchar_to_timestamp(varchar) returns timestamptz as $$

View File

@@ -0,0 +1,258 @@
-- pj_app_info definition
-- Drop table
-- DROP TABLE pj_app_info;
CREATE TABLE pj_app_info (
id int8 NOT NULL,
app_name varchar(255) NULL,
current_server varchar(255) NULL,
gmt_create timestamp NULL,
gmt_modified timestamp NULL,
"password" varchar(255) NULL,
CONSTRAINT pj_app_info_pkey PRIMARY KEY (id),
CONSTRAINT uidx01_app_info UNIQUE (app_name)
);
INSERT INTO pj_app_info VALUES(1, 'ruoyi-worker', '127.0.0.1:10010', '2023-06-13 16:32:59.263', '2023-07-04 17:25:49.798', '123456');
-- pj_container_info definition
-- Drop table
-- DROP TABLE pj_container_info;
CREATE TABLE pj_container_info (
id int8 NOT NULL,
app_id int8 NULL,
container_name varchar(255) NULL,
gmt_create timestamp NULL,
gmt_modified timestamp NULL,
last_deploy_time timestamp NULL,
source_info varchar(255) NULL,
source_type int4 NULL,
status int4 NULL,
"version" varchar(255) NULL,
CONSTRAINT pj_container_info_pkey PRIMARY KEY (id)
);
CREATE INDEX idx01_container_info ON pj_container_info USING btree (app_id);
-- pj_instance_info definition
-- Drop table
-- DROP TABLE pj_instance_info;
CREATE TABLE pj_instance_info (
id int8 NOT NULL,
actual_trigger_time int8 NULL,
app_id int8 NULL,
expected_trigger_time int8 NULL,
finished_time int8 NULL,
gmt_create timestamp NULL,
gmt_modified timestamp NULL,
instance_id int8 NULL,
instance_params oid NULL,
job_id int8 NULL,
job_params oid NULL,
last_report_time int8 NULL,
"result" oid NULL,
running_times int8 NULL,
status int4 NULL,
task_tracker_address varchar(255) NULL,
"type" int4 NULL,
wf_instance_id int8 NULL,
CONSTRAINT pj_instance_info_pkey PRIMARY KEY (id)
);
CREATE INDEX idx01_instance_info ON pj_instance_info USING btree (job_id, status);
CREATE INDEX idx02_instance_info ON pj_instance_info USING btree (app_id, status);
CREATE INDEX idx03_instance_info ON pj_instance_info USING btree (instance_id, status);
-- pj_job_info definition
-- Drop table
-- DROP TABLE pj_job_info;
CREATE TABLE pj_job_info (
id int8 NOT NULL,
alarm_config varchar(255) NULL,
app_id int8 NULL,
concurrency int4 NULL,
designated_workers varchar(255) NULL,
dispatch_strategy int4 NULL,
execute_type int4 NULL,
extra varchar(255) NULL,
gmt_create timestamp NULL,
gmt_modified timestamp NULL,
instance_retry_num int4 NULL,
instance_time_limit int8 NULL,
job_description varchar(255) NULL,
job_name varchar(255) NULL,
job_params oid NULL,
lifecycle varchar(255) NULL,
log_config varchar(255) NULL,
max_instance_num int4 NULL,
max_worker_count int4 NULL,
min_cpu_cores float8 NOT NULL,
min_disk_space float8 NOT NULL,
min_memory_space float8 NOT NULL,
next_trigger_time int8 NULL,
notify_user_ids varchar(255) NULL,
processor_info varchar(255) NULL,
processor_type int4 NULL,
status int4 NULL,
tag varchar(255) NULL,
task_retry_num int4 NULL,
time_expression varchar(255) NULL,
time_expression_type int4 NULL,
CONSTRAINT pj_job_info_pkey PRIMARY KEY (id)
);
CREATE INDEX idx01_job_info ON pj_job_info USING btree (app_id, status, time_expression_type, next_trigger_time);
INSERT INTO pj_job_info VALUES(1, '{\"alertThreshold\":0,\"silenceWindowLen\":0,\"statisticWindowLen\":0}', 1, 5, '', 2, 1, NULL, '2023-06-02 15:01:27.717', '2023-07-04 17:22:12.374', 1, 0, '', '单机处理器执行测试', NULL, '{}', '{\"type\":1}', 0, 0, 0.0, 0.0, 0.0, NULL, NULL, 'org.dromara.job.processors.StandaloneProcessorDemo', 1, 2, NULL, 1, '30000', 3);
INSERT INTO pj_job_info VALUES(2, '{\"alertThreshold\":0,\"silenceWindowLen\":0,\"statisticWindowLen\":0}', 1, 5, '', 1, 2, NULL, '2023-06-02 15:04:45.342', '2023-07-04 17:22:12.816', 0, 0, NULL, '广播处理器测试', NULL, '{}', '{\"type\":1}', 0, 0, 0.0, 0.0, 0.0, NULL, NULL, 'org.dromara.job.processors.BroadcastProcessorDemo', 1, 2, NULL, 1, '30000', 3);
INSERT INTO pj_job_info VALUES(3, '{\"alertThreshold\":0,\"silenceWindowLen\":0,\"statisticWindowLen\":0}', 1, 5, '', 1, 4, NULL, '2023-06-02 15:13:23.519', '2023-06-02 16:03:22.421', 0, 0, NULL, 'Map处理器测试', NULL, '{}', '{\"type\":1}', 0, 0, 0.0, 0.0, 0.0, NULL, NULL, 'org.dromara.job.processors.MapProcessorDemo', 1, 2, NULL, 1, '1000', 3);
INSERT INTO pj_job_info VALUES(4, '{\"alertThreshold\":0,\"silenceWindowLen\":0,\"statisticWindowLen\":0}', 1, 5, '', 1, 3, NULL, '2023-06-02 15:45:25.896', '2023-06-02 16:03:23.125', 0, 0, NULL, 'MapReduce处理器测试', NULL, '{}', '{\"type\":1}', 0, 0, 0.0, 0.0, 0.0, NULL, NULL, 'org.dromara.job.processors.MapReduceProcessorDemo', 1, 2, NULL, 1, '1000', 3);
-- pj_oms_lock definition
-- Drop table
-- DROP TABLE pj_oms_lock;
CREATE TABLE pj_oms_lock (
id int8 NOT NULL,
gmt_create timestamp NULL,
gmt_modified timestamp NULL,
lock_name varchar(255) NULL,
max_lock_time int8 NULL,
ownerip varchar(255) NULL,
CONSTRAINT pj_oms_lock_pkey PRIMARY KEY (id),
CONSTRAINT uidx01_oms_lock UNIQUE (lock_name)
);
-- pj_server_info definition
-- Drop table
-- DROP TABLE pj_server_info;
CREATE TABLE pj_server_info (
id int8 NOT NULL,
gmt_create timestamp NULL,
gmt_modified timestamp NULL,
ip varchar(255) NULL,
CONSTRAINT pj_server_info_pkey PRIMARY KEY (id),
CONSTRAINT uidx01_server_info UNIQUE (ip)
);
CREATE INDEX idx01_server_info ON pj_server_info USING btree (gmt_modified);
-- pj_user_info definition
-- Drop table
-- DROP TABLE pj_user_info;
CREATE TABLE pj_user_info (
id int8 NOT NULL,
email varchar(255) NULL,
extra varchar(255) NULL,
gmt_create timestamp NULL,
gmt_modified timestamp NULL,
"password" varchar(255) NULL,
phone varchar(255) NULL,
username varchar(255) NULL,
web_hook varchar(255) NULL,
CONSTRAINT pj_user_info_pkey PRIMARY KEY (id)
);
CREATE INDEX uidx01_user_info ON pj_user_info USING btree (username);
CREATE INDEX uidx02_user_info ON pj_user_info USING btree (email);
-- pj_workflow_info definition
-- Drop table
-- DROP TABLE pj_workflow_info;
CREATE TABLE pj_workflow_info (
id int8 NOT NULL,
app_id int8 NULL,
extra varchar(255) NULL,
gmt_create timestamp NULL,
gmt_modified timestamp NULL,
lifecycle varchar(255) NULL,
max_wf_instance_num int4 NULL,
next_trigger_time int8 NULL,
notify_user_ids varchar(255) NULL,
pedag oid NULL,
status int4 NULL,
time_expression varchar(255) NULL,
time_expression_type int4 NULL,
wf_description varchar(255) NULL,
wf_name varchar(255) NULL,
CONSTRAINT pj_workflow_info_pkey PRIMARY KEY (id)
);
CREATE INDEX idx01_workflow_info ON pj_workflow_info USING btree (app_id, status, time_expression_type, next_trigger_time);
-- pj_workflow_instance_info definition
-- Drop table
-- DROP TABLE pj_workflow_instance_info;
CREATE TABLE pj_workflow_instance_info (
id int8 NOT NULL,
actual_trigger_time int8 NULL,
app_id int8 NULL,
dag oid NULL,
expected_trigger_time int8 NULL,
finished_time int8 NULL,
gmt_create timestamp NULL,
gmt_modified timestamp NULL,
parent_wf_instance_id int8 NULL,
"result" oid NULL,
status int4 NULL,
wf_context oid NULL,
wf_init_params oid NULL,
wf_instance_id int8 NULL,
workflow_id int8 NULL,
CONSTRAINT pj_workflow_instance_info_pkey PRIMARY KEY (id),
CONSTRAINT uidx01_wf_instance UNIQUE (wf_instance_id)
);
CREATE INDEX idx01_wf_instance ON pj_workflow_instance_info USING btree (workflow_id, status, app_id, expected_trigger_time);
-- pj_workflow_node_info definition
-- Drop table
-- DROP TABLE pj_workflow_node_info;
CREATE TABLE pj_workflow_node_info (
id int8 NOT NULL,
app_id int8 NOT NULL,
"enable" bool NOT NULL,
extra oid NULL,
gmt_create timestamp NOT NULL,
gmt_modified timestamp NOT NULL,
job_id int8 NULL,
node_name varchar(255) NULL,
node_params oid NULL,
skip_when_failed bool NOT NULL,
"type" int4 NULL,
workflow_id int8 NULL,
CONSTRAINT pj_workflow_node_info_pkey PRIMARY KEY (id)
);
CREATE INDEX idx01_workflow_node_info ON pj_workflow_node_info USING btree (workflow_id, gmt_create);