Files
wechatWeb/_docs/sql/003_biz_audit.sql
张成 30a909762e 1
2026-04-01 10:58:28 +08:00

18 lines
848 B
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/model/biz_audit_log.js → tableName: biz_audit_log
SET NAMES utf8mb4;
CREATE TABLE IF NOT EXISTS `biz_audit_log` (
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
`admin_user_id` BIGINT UNSIGNED NULL DEFAULT NULL COMMENT '后台操作者 sys_user.id可空',
`biz_user_id` BIGINT UNSIGNED NULL DEFAULT NULL COMMENT '相关业务用户',
`action` VARCHAR(64) NOT NULL COMMENT '动作标识',
`resource_type` VARCHAR(64) NOT NULL DEFAULT '',
`resource_id` BIGINT UNSIGNED NULL DEFAULT NULL,
`detail` JSON NULL,
`created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `idx_biz_audit_action` (`action`),
KEY `idx_biz_audit_created` (`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='订阅模块审计';