USE pigxx_config;

DELETE FROM `pigxx_config`.`config_info` WHERE `id` = 10;

INSERT INTO `pigxx_config`.`config_info`(`id`, `data_id`, `group_id`, `content`, `md5`, `gmt_create`, `gmt_modified`, `src_user`, `src_ip`, `app_name`, `tenant_id`, `c_desc`, `c_use`, `effect`, `type`, `c_schema`, `encrypted_data_key`) VALUES (116, 'pigx-flow-engine-biz-dev.yml', 'DEFAULT_GROUP', '# 数据源\nspring:\n  datasource:\n    type: com.alibaba.druid.pool.DruidDataSource\n    druid:\n      driver-class-name: com.mysql.cj.jdbc.Driver\n      username: ${MYSQL_USER:root}\n      password: ${MYSQL_PWD:[REDACTED]      url: jdbc:mysql://${MYSQL_HOST:pigx-mysql}:${MYSQL_PORT:3309}/${MYSQL_DB:pigxx_flow}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&nullCatalogMeansCurrent=true', '233121e20445609e1ba378c3686ea7d5', '2023-07-28 13:41:32', '2023-07-28 13:43:36', 'nacos', '0:0:0:0:0:0:0:1', '', '', 'flowable 工作引擎', '', '', 'yaml', '', '');

INSERT INTO `pigxx_config`.`config_info`(`id`, `data_id`, `group_id`, `content`, `md5`, `gmt_create`, `gmt_modified`, `src_user`, `src_ip`, `app_name`, `tenant_id`, `c_desc`, `c_use`, `effect`, `type`, `c_schema`, `encrypted_data_key`) VALUES (117, 'pigx-flow-task-biz-dev.yml', 'DEFAULT_GROUP', '# 数据源\nspring:\n  datasource:\n    type: com.alibaba.druid.pool.DruidDataSource\n    druid:\n      driver-class-name: com.mysql.cj.jdbc.Driver\n      username: ${MYSQL_USER:root}\n      password: ${MYSQL_PWD:[REDACTED]      url: jdbc:mysql://${MYSQL_HOST:pigx-mysql}:${MYSQL_PORT:3309}/${MYSQL_DB:pigxx_flow}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&nullCatalogMeansCurrent=true\n\n# 租户表维护\npigx:\n  tenant:\n    column: tenant_id\n    tables:\n      - process\n      - process_copy\n      - process_group\n      - process_instance_record\n      - process_node_data\n      - process_node_record\n      - process_node_record_assign_user\n      - process_starter', 'bdead04cdd3666d04786f69e5fb32633', '2023-07-28 13:44:25', '2023-07-28 13:50:08', 'nacos', '0:0:0:0:0:0:0:1', '', '', 'flowable 业务', '', '', 'yaml', '', '');

UPDATE `pigxx_config`.`config_info` SET `data_id` = 'application-dev.yml', `group_id` = 'DEFAULT_GROUP', `content` = '# 配置文件加密根密码\njasypt:\n  encryptor:\n    password: [REDACTED]    algorithm: PBEWithMD5AndDES\n    iv-generator-classname: org.jasypt.iv.NoIvGenerator\n\n\nspring:\n  redis:\n    host: pigx-redis\n  servlet:\n    multipart:\n      max-file-size: 100MB\n      max-request-size: 100MB\n  cloud:\n    sentinel:\n      eager: true\n      transport:\n        dashboard: pigx-sentinel:5020\nfeign:\n  sentinel:\n    enabled: true\n  okhttp:\n    enabled: true\n  httpclient:\n    enabled: false\n    connection-timeout: 20000\n  compression:\n    request:\n      enabled: true\n    response:\n      enabled: true\n\n# 端点对外暴露\nmanagement:\n  endpoints:\n    web:\n      exposure:\n        include: \'*\'          \n  endpoint:\n    restart:\n      enabled: true\n    health:\n      show-details: ALWAYS\n\n#开启灰度\ngray:\n  rule:\n    enabled: true\n\n# mybatis-plus 配置\nmybatis-plus:\n  tenant-enable: ture\n  mapper-locations: classpath:/mapper/*Mapper.xml\n  global-config:\n    capitalMode: true\n    banner: false\n    db-config:\n      id-type: auto\n      select-strategy: not_empty\n      insert-strategy: not_empty\n      update-strategy: not_null\n  type-handlers-package:  com.pig4cloud.pigx.common.data.handler\n  configuration:\n    jdbc-type-for-null: \'null\'\n    call-setters-on-nulls: true\n    shrink-whitespaces-in-sql: true\nmybatis-plus-join:\n  banner: false #关闭连表查询组件banner', `md5` = '0d8e6819eaf052914700e3e24c20b227', `gmt_create` = '2022-12-16 10:44:25', `gmt_modified` = '2023-09-11 11:57:29', `src_user` = 'nacos', `src_ip` = '127.0.0.1', `app_name` = '', `tenant_id` = '', `c_desc` = '', `c_use` = '', `effect` = '', `type` = 'yaml', `c_schema` = '', `encrypted_data_key` = '' WHERE `id` = 1;

UPDATE `pigxx_config`.`config_info` SET `data_id` = 'pigx-gateway-dev.yml', `group_id` = 'DEFAULT_GROUP', `content` = 'gateway:\n  encode-key: \'pigxpigxpigxpigx\'\n\n# 验证码相关配置参考： http://t.cn/A647jEdu\naj:\n  captcha:\n    cache-type: redis\n    water-mark: pig4cloud\n\n# 固定路由转发配置 无修改\nspring:\n  cloud:\n    gateway:\n      routes:\n        - id: openapi\n          uri: lb://pigx-gateway\n          predicates:\n            - Path=/v3/api-docs/**\n          filters:\n            - RewritePath=/v3/api-docs/(?<path>.*), /$\\{path}/$\\{path}/v3/api-docs\n\n# gateway 刷新端点\nmanagement:\n  endpoint:\n    gateway:\n      enabled: true\n', `md5` = 'd138f5bafa91ab76dca8c4c1a01c1de2', `gmt_create` = '2022-12-16 10:44:25', `gmt_modified` = '2023-07-28 16:49:29', `src_user` = 'nacos', `src_ip` = '0:0:0:0:0:0:0:1', `app_name` = '', `tenant_id` = '', `c_desc` = '', `c_use` = '', `effect` = '', `type` = 'yaml', `c_schema` = '', `encrypted_data_key` = '' WHERE `id` = 5;

UPDATE `pigxx_config`.`config_info` SET `data_id` = 'pigx-upms-biz-dev.yml', `group_id` = 'DEFAULT_GROUP', `content` = '## spring security 配置\nsecurity:\n  oauth2:\n    client:\n      ignore-urls:\n        - /druid/**\n\n# 数据源\nspring:\n  autoconfigure:\n    exclude: org.springframework.cloud.gateway.config.GatewayAutoConfiguration,org.springframework.cloud.gateway.config.GatewayClassPathWarningAutoConfiguration\n  datasource:\n    type: com.alibaba.druid.pool.DruidDataSource\n    druid:\n      driver-class-name: com.mysql.cj.jdbc.Driver\n      username: ${MYSQL_USER:root}\n      password: ${MYSQL_PWD:[REDACTED]      url: jdbc:mysql://${MYSQL_HOST:pigx-mysql}:${MYSQL_PORT:3309}/${MYSQL_DB:pigxx}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true\n      stat-view-servlet:\n        enabled: true\n        allow: \"\"\n        url-pattern: /druid/*\n        #login-username: admin\n        #login-password: [REDACTED]      filter:\n        stat:\n          enabled: true\n          log-slow-sql: true\n          slow-sql-millis: 10000\n          merge-sql: false\n        wall:\n          config:\n            multi-statement-allow: true\n\n# 本地文件系统\nfile:\n  local:\n    enable: true\n    basePath: /Users/lengleng/Downloads/files\n\n# Logger Config\nlogging:\n  level:\n    com.pig4cloud.pigx.admin.mapper: debug\n\n# 租户表维护\npigx:\n  tenant:\n    column: tenant_id\n    tables:\n      - sys_user\n      - sys_role\n      - sys_menu\n      - sys_dept\n      - sys_log\n      - sys_social_details\n      - sys_dict\n      - sys_dict_item\n      - sys_public_param\n      - sys_log\n      - sys_file\n      - sys_file_group\n      - sys_oauth_client_details\n      - sys_post', `md5` = 'a37e3dc8cf649be64bd35cc5e5e355a9', `gmt_create` = '2022-12-16 10:44:25', `gmt_modified` = '2023-07-28 13:47:59', `src_user` = 'nacos', `src_ip` = '0:0:0:0:0:0:0:1', `app_name` = '', `tenant_id` = '', `c_desc` = '', `c_use` = '', `effect` = '', `type` = 'yaml', `c_schema` = '', `encrypted_data_key` = '' WHERE `id` = 7;

UPDATE `pigxx_config`.`config_info` SET `data_id` = 'pigx-jimu-platform-dev.yml', `group_id` = 'DEFAULT_GROUP', `content` = 'spring:\n  #配置静态资源\n  mvc:\n    static-path-pattern: /**\n  resource:\n    static-locations: classpath:/static/\n  #配置数据库\n  datasource:\n    type: com.alibaba.druid.pool.DruidDataSource\n    druid:\n      driver-class-name: com.mysql.cj.jdbc.Driver\n      username: ${MYSQL_USER:root}\n      password: ${MYSQL_PWD:[REDACTED]      url: jdbc:mysql://${MYSQL_HOST:pigx-mysql}:${MYSQL_PORT:3309}/${MYSQL_DB:pigxx_bi}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true\n   \n#JimuReport[minidao配置]\nminidao :\n  base-package: org.jeecg.modules.jmreport.desreport.dao*\n  db-type: mysql\n#JimuReport[上传配置]\njeecg :\n  jmreport:\n    saas: true\n    openTenant: true\n    #saasMode: tenant\n    customPrePath: /api/jimu\n    # 自动保存\n    autoSave: true\n    # 单位毫秒 默认5*60*1000 \n    interval: 10000\n  # local|minio|alioss\n  uploadType: local\n  # local\n  path :\n    #文件路径A\n    upload: ~/jimu/data\n  # alioss\n  oss:\n    endpoint: oss-cn-beijing.aliyuncs.com\n    accessKey: ??\n    secretKey: ??\n    staticDomain: ??\n    bucketName: ??\n  # minio\n  minio:\n    minio_url: http://minio.jeecg.com\n    minio_name: ??\n    minio_pass: ??\n    bucketName: ??\n#输出sql日志\nlogging:\n  level:\n    org.jeecg.modules.jmreport : debug', `md5` = '1397b44dcc28a7fb5fd455805b932983', `gmt_create` = '2022-12-16 10:44:25', `gmt_modified` = '2023-09-08 13:06:11', `src_user` = 'nacos', `src_ip` = '0:0:0:0:0:0:0:1', `app_name` = '', `tenant_id` = '', `c_desc` = '', `c_use` = '', `effect` = '', `type` = 'yaml', `c_schema` = '', `encrypted_data_key` = '' WHERE `id` = 14;

USE pigxx;

CREATE TABLE `pigxx`.`sys_file_group`  (
  `id` bigint(0) UNSIGNED NOT NULL COMMENT '主键ID',
  `type` tinyint(0) UNSIGNED NULL DEFAULT 10 COMMENT '类型: [10=图片, 20=视频]',
  `name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '分类名称',
  `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
  `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
  `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标记',
  `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人',
  `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '修改人',
  `tenant_id` bigint(0) NULL DEFAULT NULL COMMENT '租户',
  `pid` bigint(0) NULL DEFAULT NULL COMMENT '父ID',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文件分类表' ROW_FORMAT = DYNAMIC;

ALTER TABLE `pigxx`.`sys_tenant` ADD COLUMN `website_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网站名称' AFTER `tenant_domain`;

ALTER TABLE `pigxx`.`sys_tenant` ADD COLUMN `mini_qr` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '移动端二维码' AFTER `website_name`;

ALTER TABLE `pigxx`.`sys_tenant` ADD COLUMN `background` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '登录页背景图' AFTER `mini_qr`;

ALTER TABLE `pigxx`.`sys_tenant` ADD COLUMN `footer` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '页脚信息' AFTER `background`;

ALTER TABLE `pigxx`.`sys_tenant` ADD COLUMN `logo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'logo' AFTER `footer`;

ALTER TABLE `pigxx`.`sys_tenant` MODIFY COLUMN `id` bigint(0) NOT NULL COMMENT '租户ID' FIRST;

ALTER TABLE `pigxx`.`sys_tenant` MODIFY COLUMN `menu_id` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '租户菜单ID' AFTER `update_time`;

DROP TABLE `pigxx`.`sys_tenant_menu`;

DELETE FROM `pigxx`.`sys_menu` WHERE `menu_id` = 6009;

DELETE FROM `pigxx`.`sys_menu` WHERE `menu_id` = 6010;

DELETE FROM `pigxx`.`sys_menu` WHERE `menu_id` = 6011;

DELETE FROM `pigxx`.`sys_menu` WHERE `menu_id` = 6012;

DELETE FROM `pigxx`.`sys_menu` WHERE `menu_id` = 6013;

DELETE FROM `pigxx`.`sys_menu` WHERE `menu_id` = 6014;

DELETE FROM `pigxx`.`sys_menu` WHERE `menu_id` = 6015;

DELETE FROM `pigxx`.`sys_menu` WHERE `menu_id` = 6016;

DELETE FROM `pigxx`.`sys_menu` WHERE `menu_id` = 6017;

DELETE FROM `pigxx`.`sys_menu` WHERE `menu_id` = 6018;

DELETE FROM `pigxx`.`sys_menu` WHERE `menu_id` = 6019;

UPDATE `pigxx`.`sys_menu` SET `name` = '协同办公', `permission` = NULL, `path` = '/flow', `parent_id` = -1, `icon` = 'ele-Present', `visible` = '1', `sort_order` = 5, `keep_alive` = '0', `embedded` = '0', `menu_type` = '0', `create_by` = 'admin', `create_time` = '2023-03-02 16:36:49', `update_by` = 'admin', `update_time` = '2023-07-27 13:12:32', `del_flag` = '0', `tenant_id` = 1 WHERE `menu_id` = 6000;

UPDATE `pigxx`.`sys_menu` SET `name` = '流程管理', `permission` = NULL, `path` = '/flow/group/index', `parent_id` = 6000, `icon` = 'iconfont icon-gongju', `visible` = '1', `sort_order` = 0, `keep_alive` = '0', `embedded` = '0', `menu_type` = '0', `create_by` = 'admin', `create_time` = '2023-03-02 16:37:55', `update_by` = 'admin', `update_time` = '2023-07-27 13:12:42', `del_flag` = '0', `tenant_id` = 1 WHERE `menu_id` = 6001;

UPDATE `pigxx`.`sys_menu` SET `name` = '创建流程', `permission` = NULL, `path` = '/flow/create/all', `parent_id` = 6000, `icon` = 'fa fa-arrow-circle-right', `visible` = '0', `sort_order` = 2, `keep_alive` = '0', `embedded` = NULL, `menu_type` = '0', `create_by` = '', `create_time` = '2023-07-27 13:14:56', `update_by` = 'admin', `update_time` = '2023-07-27 13:32:32', `del_flag` = '0', `tenant_id` = 1 WHERE `menu_id` = 6002;

UPDATE `pigxx`.`sys_menu` SET `name` = '发起流程', `permission` = NULL, `path` = '/flow/list/index', `parent_id` = 6000, `icon` = 'fa fa-play', `visible` = '1', `sort_order` = 1, `keep_alive` = '0', `embedded` = '0', `menu_type` = '0', `create_by` = 'admin', `create_time` = '2023-03-02 18:18:10', `update_by` = 'admin', `update_time` = '2023-07-27 13:29:00', `del_flag` = '0', `tenant_id` = 1 WHERE `menu_id` = 6003;

UPDATE `pigxx`.`sys_menu` SET `name` = '任务管理', `permission` = NULL, `path` = '/task', `parent_id` = 6000, `icon` = 'fa fa-th', `visible` = '1', `sort_order` = 2, `keep_alive` = '0', `embedded` = '0', `menu_type` = '0', `create_by` = 'admin', `create_time` = '2023-03-02 22:13:29', `update_by` = 'admin', `update_time` = '2023-07-27 13:29:17', `del_flag` = '0', `tenant_id` = 1 WHERE `menu_id` = 6004;

UPDATE `pigxx`.`sys_menu` SET `name` = '代办任务', `permission` = NULL, `path` = '/task/pending', `parent_id` = 6004, `icon` = 'fa fa-flag-checkered', `visible` = '1', `sort_order` = 0, `keep_alive` = '0', `embedded` = '0', `menu_type` = '0', `create_by` = 'admin', `create_time` = '2023-03-02 22:59:35', `update_by` = 'admin', `update_time` = '2023-07-27 13:32:18', `del_flag` = '0', `tenant_id` = 1 WHERE `menu_id` = 6005;

UPDATE `pigxx`.`sys_menu` SET `name` = '我的已办', `permission` = NULL, `path` = '/task/completed', `parent_id` = 6004, `icon` = 'fa fa-hand-o-right', `visible` = '1', `sort_order` = 3, `keep_alive` = '0', `embedded` = '0', `menu_type` = '0', `create_by` = 'admin', `create_time` = '2023-03-02 23:23:13', `update_by` = 'admin', `update_time` = '2023-07-27 13:30:51', `del_flag` = '0', `tenant_id` = 1 WHERE `menu_id` = 6006;

UPDATE `pigxx`.`sys_menu` SET `name` = '我的发起', `permission` = NULL, `path` = '/task/started', `parent_id` = 6004, `icon` = 'fa fa-plane', `visible` = '1', `sort_order` = 1, `keep_alive` = '0', `embedded` = NULL, `menu_type` = '0', `create_by` = '', `create_time` = '2023-07-27 13:14:51', `update_by` = 'admin', `update_time` = '2023-07-27 13:29:47', `del_flag` = '0', `tenant_id` = 1 WHERE `menu_id` = 6007;

UPDATE `pigxx`.`sys_menu` SET `name` = '抄送给我', `permission` = NULL, `path` = '/task/cc', `parent_id` = 6004, `icon` = 'fa fa-arrow-circle-right', `visible` = '1', `sort_order` = 2, `keep_alive` = '0', `embedded` = NULL, `menu_type` = '0', `create_by` = '', `create_time` = '2023-07-27 13:14:56', `update_by` = 'admin', `update_time` = '2023-07-27 13:32:32', `del_flag` = '0', `tenant_id` = 1 WHERE `menu_id` = 6008;

USE pigxx_codegen;

ALTER TABLE `pigxx_codegen`.`gen_table` AUTO_INCREMENT = 0;

ALTER TABLE `pigxx_codegen`.`gen_group` MODIFY COLUMN `id` bigint(0) NOT NULL FIRST;

ALTER TABLE `pigxx_codegen`.`gen_group` MODIFY COLUMN `tenant_id` bigint(0) NOT NULL COMMENT '租户ID' AFTER `group_desc`;

ALTER TABLE `pigxx_codegen`.`gen_table` MODIFY COLUMN `i18n` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '是否生成带有i18n 0 不带有 1带有' AFTER `version`;

ALTER TABLE `pigxx_codegen`.`gen_table` MODIFY COLUMN `style` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '代码风格' AFTER `i18n`;

ALTER TABLE `pigxx_codegen`.`gen_table` MODIFY COLUMN `generator_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '生成方式  0：zip压缩包   1：自定义目录' AFTER `child_field`;

ALTER TABLE `pigxx_codegen`.`gen_table` MODIFY COLUMN `form_layout` tinyint(0) NULL DEFAULT NULL COMMENT '表单布局  1：一列   2：两列' AFTER `function_name`;

ALTER TABLE `pigxx_codegen`.`gen_table_column` MODIFY COLUMN `primary_pk` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '主键 0：否  1：是' AFTER `auto_fill`;

ALTER TABLE `pigxx_codegen`.`gen_table_column` MODIFY COLUMN `base_field` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '基类字段 0：否  1：是' AFTER `primary_pk`;

ALTER TABLE `pigxx_codegen`.`gen_table_column` MODIFY COLUMN `form_item` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '表单项 0：否  1：是' AFTER `base_field`;

ALTER TABLE `pigxx_codegen`.`gen_table_column` MODIFY COLUMN `form_required` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '表单必填 0：否  1：是' AFTER `form_item`;

ALTER TABLE `pigxx_codegen`.`gen_table_column` MODIFY COLUMN `grid_item` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '列表项 0：否  1：是' AFTER `form_validator`;

ALTER TABLE `pigxx_codegen`.`gen_table_column` MODIFY COLUMN `grid_sort` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '列表排序 0：否  1：是' AFTER `grid_item`;

ALTER TABLE `pigxx_codegen`.`gen_table_column` MODIFY COLUMN `query_item` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '查询项 0：否  1：是' AFTER `grid_sort`;
