{
  "id": "python/django-migration-irreversible",
  "signature": "django.db.migrations.exceptions.IrreversibleError: Migration 0002_auto cannot be reversed",
  "signature_zh": "Django迁移不可逆错误：迁移0002_auto无法回滚",
  "regex": "django\\.db\\.migrations\\.exceptions\\.IrreversibleError:\\ Migration\\ 0002_auto\\ cannot\\ be\\ reversed",
  "domain": "python",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "A migration contains operations that are not reversible, such as RunSQL without reverse code.",
  "root_cause_type": "generic",
  "root_cause_zh": "迁移包含不可逆的操作，例如没有反向代码的RunSQL。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Forcing reverse migration with --fake",
      "why_fails": "May leave database in inconsistent state.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Deleting migration files",
      "why_fails": "Breaks migration chain; may cause future errors.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Add reverse code to RunSQL operations",
      "success_rate": 0.9,
      "how": "migrations.RunSQL(sql, reverse_sql='DROP TABLE ...')",
      "condition": "",
      "sources": []
    },
    {
      "action": "Create a new migration to revert changes",
      "success_rate": 0.85,
      "how": "Generate a new migration that reverses the effects.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.83,
  "fix_success_rate": 0.8,
  "resolvable": "partial",
  "first_seen": "2024-06-10",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}