{
  "id": "python/flask-migrate-target-database-not-up-to-date",
  "signature": "alembic.util.exc.CommandError: Target database is not up to date.",
  "signature_zh": "alembic.util.exc.CommandError: 目标数据库不是最新的。",
  "regex": "alembic\\.util\\.exc\\.CommandError:\\ Target\\ database\\ is\\ not\\ up\\ to\\ date\\.",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "Running `flask db migrate` while the DB revision is behind the latest migration head, or after manual schema edits.",
  "root_cause_type": "generic",
  "root_cause_zh": "在数据库版本落后于最新迁移头时运行 `flask db migrate`，或手动修改了 schema。",
  "versions": [
    {
      "version": "4.0.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Loses migration history; production DB will not match.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Offline mode still requires up-to-date revision.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Run `flask db upgrade` first, then `flask db migrate -m 'msg'` and `flask db upgrade` again.",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "If DB drifted, stamp: `flask db stamp head` after manually aligning schema, then migrate.",
      "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.87,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-03-20",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}