-- Remove trial/placeholder ANH artifacts. These were never confirmed contracts
-- and must not appear as regulatory reports.

DELETE FROM anh_reports
WHERE upper(btrim(COALESCE(contract_number, content ->> 'CONTRATO', ''))) LIKE 'PENDING-%'
   OR upper(btrim(COALESCE(contract_number, content ->> 'CONTRATO', ''))) LIKE 'TRIAL-%';

DELETE FROM anh_report_schedules
WHERE upper(btrim(contract_number)) LIKE 'PENDING-%'
   OR upper(btrim(contract_number)) LIKE 'TRIAL-%';
