{
  "id": "python/django-migration-missing-table",
  "signature": "django.db.utils.OperationalError: no such table: myapp_mymodel",
  "signature_zh": "数据库操作错误：表 myapp_mymodel 不存在",
  "regex": "django\\.db\\.utils\\.OperationalError:\\ no\\ such\\ table:\\ myapp_mymodel",
  "domain": "python",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "迁移未应用或迁移文件缺失导致数据库表未创建",
  "root_cause_type": "generic",
  "root_cause_zh": "未运行迁移或迁移文件丢失，导致数据库中缺少对应的表",
  "versions": [
    {
      "version": "3.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "4.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "手动创建表",
      "why_fails": "Django 的 ORM 期望表结构与迁移一致，手动创建会导致字段不匹配",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "删除迁移文件重新生成",
      "why_fails": "删除迁移文件会丢失历史记录，可能导致后续迁移冲突",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "运行迁移命令",
      "success_rate": 0.95,
      "how": "python manage.py migrate myapp",
      "condition": "",
      "sources": []
    },
    {
      "action": "创建初始迁移并迁移",
      "success_rate": 0.9,
      "how": "python manage.py makemigrations myapp && python manage.py migrate myapp",
      "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.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-03-15",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}