-- Revert mig 100 — remove the upc.inf.cfi.ccr informational rule and
-- restore the sequence_order values of def_to_ccr / app_to_amend.

SELECT set_config(
    'paliad.audit_reason',
    'mig 100 down: revert upc.inf.cfi.ccr informational rule + sequence reshuffle',
    true);

UPDATE paliad.deadline_rules
   SET sequence_order = 12
 WHERE submission_code = 'upc.inf.cfi.app_to_amend'
   AND proceeding_type_id = 8
   AND lifecycle_state = 'published'
   AND sequence_order = 13;

UPDATE paliad.deadline_rules
   SET sequence_order = 11
 WHERE submission_code = 'upc.inf.cfi.def_to_ccr'
   AND proceeding_type_id = 8
   AND lifecycle_state = 'published'
   AND sequence_order = 12;

DELETE FROM paliad.deadline_rules
 WHERE submission_code = 'upc.inf.cfi.ccr'
   AND proceeding_type_id = 8
   AND lifecycle_state = 'published';
