-- version: 3
-- Drop the (batch_id, patient_control_number) unique index on claims
-- and the (batch_id, payer_claim_control_number) unique index on remittances.
-- X12 837P allows any number of CLM segments per 2000B subscriber loop
-- (real CO Medicaid submissions have multiple claims per member per
-- batch), and 835 ERAs can repeat a payer_claim_control_number for
-- reversals. Claim/remittance identity is provided by the primary key
-- (claims.id = CLM01, remittances.id = CLP01) so the unique-per-batch
-- constraints were over-constraining and broke real production data.
--
-- IF EXISTS so the migration is idempotent: a fresh DB that never had
-- 0001 with the constraints (new checkouts, test DBs) skips cleanly.
DROP INDEX IF EXISTS uq_claims_batch_pcn;
DROP INDEX IF EXISTS uq_remits_batch_pcn;
