-- 扩展 Integration Log 终态，支持入站幂等或资源唯一性冲突。
ALTER TABLE tb_integration_log
    DROP CONSTRAINT IF EXISTS ck_integration_log_result;

ALTER TABLE tb_integration_log
    ADD CONSTRAINT ck_integration_log_result CHECK (result IN (
        'pending', 'success', 'failed', 'unknown', 'not_found', 'invalid_payload',
        'conflict', 'ignored', 'merged', 'rate_limited', 'completed', 'cancelled'
    ));
