-- 回滚外部集成调查组合索引,并恢复原有技术序列与业务链路索引定义。 DROP INDEX idx_integration_log_result_created; DROP INDEX idx_integration_log_provider_created; DROP INDEX idx_integration_log_external_created; DROP INDEX idx_integration_log_audit_event_created; DROP INDEX idx_integration_log_trigger; CREATE INDEX idx_integration_log_trigger ON tb_integration_log (trigger_series, attempt); DROP INDEX idx_integration_log_correlation; CREATE INDEX idx_integration_log_correlation ON tb_integration_log (correlation_id, created_at ASC) WHERE correlation_id IS NOT NULL; COMMENT ON TABLE tb_integration_log IS '外部集成调用、回调及未发送尝试记录'; COMMENT ON COLUMN tb_integration_log.id IS '外部集成记录主键ID'; COMMENT ON COLUMN tb_integration_log.result IS '尝试结果,pending仅为内部执行态,其余为公开终态'; COMMENT ON COLUMN tb_integration_log.provider IS '外部服务提供方稳定编码'; COMMENT ON COLUMN tb_integration_log.external_id IS '外部系统返回的业务或请求标识'; COMMENT ON COLUMN tb_integration_log.audit_event_id IS '关联审计事件ID,仅代码显式维护且不建立外键'; COMMENT ON COLUMN tb_integration_log.trigger_series IS '同一次外部操作显式技术尝试序列的稳定标识'; COMMENT ON COLUMN tb_integration_log.attempt IS '同一技术尝试序列内的单调尝试序号'; COMMENT ON COLUMN tb_integration_log.correlation_id IS '跨请求、异步任务与业务后续步骤的关联ID,最长100字符'; COMMENT ON COLUMN tb_integration_log.created_at IS '外部集成记录创建时间';