Skip to content

Commit 6c984a5

Browse files
committed
fix: make api_keys.user_id index explicit in model
The index was created by the original migration but wasn't marked in the model definition. This prevents confusion when running alembic autogenerate.
1 parent 63a0dcb commit 6c984a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/models/api_key.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class ApiKey(Base):
1818
id: Mapped[uuid.UUID] = mapped_column(
1919
UUID(as_uuid=True), primary_key=True, default=uuid.uuid4
2020
)
21-
user_id: Mapped[int] = mapped_column(ForeignKey("users.id"))
21+
user_id: Mapped[int] = mapped_column(ForeignKey("users.id"), index=True)
2222
key: Mapped[str] = mapped_column(String(255), unique=True, index=True)
2323
name: Mapped[str] = mapped_column(String(50))
2424
created_at: Mapped[datetime] = mapped_column(

0 commit comments

Comments
 (0)