{
  "id": "python/sqlalchemy-missing-ondelete-option",
  "signature": "sqlalchemy.exc.NoForeignKeysError: Could not determine join condition between parent/child tables on relationship 'User.addresses' - there are no foreign keys linking these tables. Ensure that referencing columns are associated with a ForeignKey or ForeignKeyConstraint, or specify a 'primaryjoin' expression.",
  "signature_zh": "无法确定父/子表之间的关系 'User.addresses' 的连接条件 - 没有外键链接这些表。确保引用列与外键关联，或指定 'primaryjoin' 表达式。",
  "regex": "sqlalchemy\\.exc\\.NoForeignKeysError:\\ Could\\ not\\ determine\\ join\\ condition\\ between\\ parent/child\\ tables\\ on\\ relationship\\ 'User\\.addresses'\\ \\-\\ there\\ are\\ no\\ foreign\\ keys\\ linking\\ these\\ tables\\.\\ Ensure\\ that\\ referencing\\ columns\\ are\\ associated\\ with\\ a\\ ForeignKey\\ or\\ ForeignKeyConstraint,\\ or\\ specify\\ a\\ 'primaryjoin'\\ expression\\.",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "A relationship is defined without a foreign key constraint between the tables, or the FK is not properly declared.",
  "root_cause_type": "generic",
  "root_cause_zh": "表之间定义关系时没有外键约束，或外键未正确声明。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "It's just a regular column; no constraint.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "May cause ambiguous joins.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "class Address(Base):\n    __tablename__ = 'addresses'\n    user_id = Column(Integer, ForeignKey('users.id'))\nclass User(Base):\n    addresses = relationship('Address')",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.8,
      "how": "class User(Base):\n    addresses = relationship('Address', primaryjoin='User.id == Address.user_id')",
      "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.86,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-03-11",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}