-- Migration 081: Add 'duplicate' release_state for obligation deduplication
--
-- Allows marking duplicate obligation_candidates as 'duplicate' instead of
-- deleting them, preserving traceability via merged_into_id.

ALTER TABLE obligation_candidates
    DROP CONSTRAINT IF EXISTS obligation_candidates_release_state_check;

ALTER TABLE obligation_candidates
    ADD CONSTRAINT obligation_candidates_release_state_check
        CHECK (release_state IN ('extracted', 'validated', 'rejected', 'composed', 'merged', 'duplicate'));
