Files
tiesheng-springboot/springboot-web/src/main/resources/db/migration/tiesheng_init_log.sql
曾文豪 101270e881 perf(web):操作日志优化
1,不再返回params字段
2,params字段有text改为longtext
2023-07-11 08:58:48 +08:00

94 lines
3.5 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for core_log_login
-- ----------------------------
CREATE TABLE `core_log_login`
(
`id` varchar(50) NOT NULL,
`create_time` datetime NOT NULL,
`update_time` datetime NOT NULL,
`is_deleted` int(6) NOT NULL DEFAULT '0',
`user_id` varchar(50) DEFAULT NULL COMMENT '用户id',
`user_name` varchar(255) DEFAULT NULL COMMENT '用户姓名',
`platform` varchar(50) DEFAULT NULL COMMENT '登录方式',
`ip` varchar(100) DEFAULT NULL COMMENT 'ip',
`address` varchar(255) DEFAULT NULL COMMENT 'ip地址',
PRIMARY KEY (`id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='日志-登录';
-- ----------------------------
-- Table structure for core_log_message
-- ----------------------------
CREATE TABLE `core_log_message`
(
`id` varchar(50) NOT NULL,
`create_time` datetime NOT NULL,
`update_time` datetime NOT NULL,
`is_deleted` int(6) NOT NULL DEFAULT '0',
`type` varchar(50) DEFAULT NULL COMMENT '类型',
`target` varchar(255) DEFAULT NULL COMMENT '发送对象',
`content` text COMMENT '发送内容',
`resp_body` text COMMENT '返回结果',
`result` int(6) NOT NULL DEFAULT '0' COMMENT '结果',
PRIMARY KEY (`id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
ROW_FORMAT = DYNAMIC COMMENT ='日志-消息';
-- ----------------------------
-- Table structure for core_log_process
-- ----------------------------
CREATE TABLE `core_log_process`
(
`id` varchar(50) NOT NULL,
`create_time` datetime NOT NULL,
`update_time` datetime NOT NULL,
`is_deleted` int(6) NOT NULL DEFAULT 0,
`title` varchar(255) NULL DEFAULT NULL COMMENT '标题',
`total` int(11) NOT NULL DEFAULT 0 COMMENT '总数',
`success_num` int(11) NOT NULL DEFAULT 0 COMMENT '成功数',
`fail_num` int(11) NOT NULL DEFAULT 0 COMMENT '失败数',
`type` varchar(50) NOT NULL DEFAULT 'import' COMMENT '类型import-导入sync-同步)',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_general_ci COMMENT = '日志-过程'
ROW_FORMAT = Dynamic;
ALTER TABLE core_log_process
ADD status int(6) default 0 COMMENT '状态0-未完成1-已完成)';
ALTER TABLE core_log_process
ADD fail_file varchar(500) null default null COMMENT '失败的文件';
ALTER TABLE core_log_process
ADD error text null default null COMMENT '异常说明';
ALTER TABLE core_log_process
ADD process int(6) not null default 0 COMMENT '进度';
-- ----------------------------
-- Table structure for core_log_operation
-- ----------------------------
CREATE TABLE `core_log_operation`
(
`id` varchar(50) NOT NULL,
`create_time` datetime NOT NULL,
`update_time` datetime NOT NULL,
`is_deleted` int(6) NOT NULL DEFAULT '0',
`user_id` varchar(50) DEFAULT NULL COMMENT '用户id',
`user_name` varchar(255) DEFAULT NULL COMMENT '用户名称',
`title` varchar(255) DEFAULT NULL COMMENT '标题',
`subject` varchar(500) DEFAULT NULL COMMENT '小标题',
`params` longtext COMMENT '其他参数',
PRIMARY KEY (`id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='日志-操作';
SET FOREIGN_KEY_CHECKS = 1;