DELETE FROM qipai_schema_migrations WHERE version = '2026081005';

DROP TABLE IF EXISTS qipai_cleaning_task_submissions;
DROP TABLE IF EXISTS qipai_cleaning_task_photos;

ALTER TABLE qipai_cleaning_tasks
  DROP FOREIGN KEY fk_qipai_cleaning_tasks_template,
  DROP CONSTRAINT chk_qipai_cleaning_task_photo_rule,
  DROP CONSTRAINT chk_qipai_cleaning_task_exempt_policy,
  DROP COLUMN rework_count,
  DROP COLUMN exempt_policy,
  DROP COLUMN max_photo_count,
  DROP COLUMN min_photo_count,
  DROP COLUMN photo_required,
  DROP COLUMN cleaning_template_version,
  DROP COLUMN cleaning_template_id;

DROP TABLE IF EXISTS qipai_cleaning_templates;
