mirror of
https://github.com/karpathy/nanochat.git
synced 2026-05-07 16:30:11 +00:00
fix(chat-api): use_alter on users FK to avoid metadata resolution error
Chat-api doesn't define the users model (owned by auth service), so SQLAlchemy can't resolve the FK. use_alter=True defers the constraint to ALTER TABLE, avoiding the NoReferencedTableError at startup. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
40ce6c1a89
commit
e8222011d9
|
|
@ -24,7 +24,7 @@ class Conversation(Base):
|
|||
)
|
||||
user_id: Mapped[uuid.UUID] = mapped_column(
|
||||
sa.Uuid(as_uuid=True),
|
||||
sa.ForeignKey("users.id", ondelete="CASCADE"),
|
||||
sa.ForeignKey("users.id", ondelete="CASCADE", use_alter=True),
|
||||
nullable=False,
|
||||
index=True,
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user