feat: add IM admin management
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
CREATE TABLE IF NOT EXISTS im_audit_logs (
|
||||
id BIGINT NOT NULL AUTO_INCREMENT,
|
||||
actor_uid BIGINT NOT NULL DEFAULT 0,
|
||||
actor_role VARCHAR(64) NOT NULL DEFAULT '',
|
||||
action VARCHAR(128) NOT NULL,
|
||||
target_type VARCHAR(64) NOT NULL DEFAULT '',
|
||||
target_id VARCHAR(128) NOT NULL DEFAULT '',
|
||||
before_snapshot JSON,
|
||||
after_snapshot JSON,
|
||||
reason VARCHAR(512) NOT NULL DEFAULT '',
|
||||
request_id VARCHAR(64) NOT NULL DEFAULT '',
|
||||
ip VARCHAR(64) NOT NULL DEFAULT '',
|
||||
user_agent VARCHAR(512) NOT NULL DEFAULT '',
|
||||
metadata JSON,
|
||||
created_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
|
||||
PRIMARY KEY (id),
|
||||
INDEX idx_im_audit_logs_actor (actor_uid, id DESC),
|
||||
INDEX idx_im_audit_logs_action (action, id DESC),
|
||||
INDEX idx_im_audit_logs_target (target_type, target_id, id DESC),
|
||||
INDEX idx_im_audit_logs_request (request_id),
|
||||
INDEX idx_im_audit_logs_created (created_at, id DESC)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='IM租户审计日志';
|
||||
Reference in New Issue
Block a user