Files
junhong_cmp_fiber/migrations/000167_create_audit_integration_log.down.sql
break ff44305d0e
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 10m19s
实现审计覆盖门禁与外部集成日志闭环
2026-07-23 21:31:22 +09:00

12 lines
412 B
SQL

-- 已产生外部交互事实后禁止通过降级删除,避免链路历史丢失。
DO $$
BEGIN
IF to_regclass('tb_integration_log') IS NOT NULL
AND EXISTS (SELECT 1 FROM tb_integration_log LIMIT 1) THEN
RAISE EXCEPTION 'tb_integration_log 已存在外部交互事实,禁止删表回滚,请停止生产者后向前修复';
END IF;
END
$$;
DROP TABLE IF EXISTS tb_integration_log;