DROP INDEX IF EXISTS idx_desktop_publish_jobs_status_scheduled;

ALTER TABLE desktop_publish_jobs
    DROP COLUMN IF EXISTS compliance_blocked_reason,
    DROP COLUMN IF EXISTS compliance_blocked_at,
    DROP COLUMN IF EXISTS compliance_blocked_record_id,
    DROP COLUMN IF EXISTS status,
    DROP COLUMN IF EXISTS article_version_id,
    DROP COLUMN IF EXISTS article_id;

ALTER TABLE article_versions
    DROP CONSTRAINT IF EXISTS fk_article_versions_manual_review;

DROP TABLE IF EXISTS compliance_manual_reviews;
DROP TABLE IF EXISTS compliance_review_jobs;

ALTER TABLE compliance_violations
    DROP CONSTRAINT IF EXISTS fk_compliance_violations_ack;

DROP TABLE IF EXISTS compliance_ack_records;
DROP TABLE IF EXISTS compliance_violations;
DROP TABLE IF EXISTS compliance_check_records;

ALTER TABLE article_versions
    DROP CONSTRAINT IF EXISTS ck_article_versions_manual_review_status,
    DROP COLUMN IF EXISTS manual_review_updated_at,
    DROP COLUMN IF EXISTS manual_review_id,
    DROP COLUMN IF EXISTS manual_review_status,
    DROP COLUMN IF EXISTS plaintext_snapshot;
