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:
Manmohan Sharma 2026-04-16 14:40:45 -07:00
parent 40ce6c1a89
commit e8222011d9
No known key found for this signature in database

View File

@ -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,
)