-- Reverses 044_dpma_proceedings.

DELETE FROM paliad.deadline_rules
 WHERE proceeding_type_id IN (
        SELECT id FROM paliad.proceeding_types
         WHERE code IN ('DPMA_OPP','DPMA_BPATG_BESCHWERDE','DPMA_BGH_RB')
       );

DELETE FROM paliad.proceeding_types
 WHERE code IN ('DPMA_OPP','DPMA_BPATG_BESCHWERDE','DPMA_BGH_RB');

DELETE FROM paliad.deadline_concepts
 WHERE slug IN ('rechtsbeschwerde','rechtsbeschwerde-begruendung')
   AND id NOT IN (SELECT concept_id FROM paliad.deadline_rules WHERE concept_id IS NOT NULL);
