Files
ycc-proxy-server/deploy/sql/query_whitelist_op_log_migration.sql
2026-06-19 11:27:53 +08:00

35 lines
2.1 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.

-- ============================================
-- 查询白名单操作记录表
-- 记录后台管理员通过天远 API 创建/追加屏蔽规则的操作
-- ============================================
CREATE TABLE IF NOT EXISTS `query_whitelist_op_log` (
`id` CHAR(36) NOT NULL COMMENT 'UUID主键',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`delete_time` datetime DEFAULT NULL COMMENT '删除时间',
`del_state` tinyint NOT NULL DEFAULT '0' COMMENT '删除状态0=未删除1=已删除',
`version` bigint NOT NULL DEFAULT '0' COMMENT '版本号(乐观锁)',
`admin_user_id` CHAR(36) NOT NULL COMMENT '操作管理员ID',
`action` varchar(20) NOT NULL COMMENT '操作类型create=创建规则append=追加接口',
`name` varchar(50) NOT NULL DEFAULT '*' COMMENT '姓名规则',
`id_card` varchar(50) NOT NULL COMMENT '身份证号(明文,供后台审计)',
`id_card_masked` varchar(50) DEFAULT NULL COMMENT '天远返回的脱敏身份证号',
`api_codes` varchar(2000) NOT NULL COMMENT '本次提交的产品编码JSON数组',
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
`tianyuan_code` int NOT NULL DEFAULT 0 COMMENT '天远 API 业务码',
`tianyuan_message` varchar(500) DEFAULT NULL COMMENT '天远 API 返回描述',
`transaction_id` varchar(64) DEFAULT NULL COMMENT '天远 API 流水号',
`entry_id` varchar(64) DEFAULT NULL COMMENT '天远规则ID成功时',
`entry_status` varchar(20) DEFAULT NULL COMMENT '规则状态(成功时)',
`entry_api_codes` varchar(2000) DEFAULT NULL COMMENT '规则当前产品编码列表JSON数组成功时',
PRIMARY KEY (`id`),
KEY `idx_admin_user_id` (`admin_user_id`),
KEY `idx_id_card` (`id_card`),
KEY `idx_action` (`action`),
KEY `idx_tianyuan_code` (`tianyuan_code`),
KEY `idx_create_time` (`create_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='查询白名单操作记录表';