diff --git a/backend/app/models/audit.py b/backend/app/models/audit.py index 4b7e90f..7790336 100644 --- a/backend/app/models/audit.py +++ b/backend/app/models/audit.py @@ -81,9 +81,9 @@ class AuditLog(Base): user: Mapped[Optional["User"]] = relationship(foreign_keys=[user_id]) __table_args__ = ( - Index("idx_user", "user_id"), - Index("idx_entity", "entity_type", "entity_id"), - Index("idx_created", "created_at"), + Index("idx_al_user", "user_id"), + Index("idx_al_entity", "entity_type", "entity_id"), + Index("idx_al_created", "created_at"), ) diff --git a/backend/app/models/case.py b/backend/app/models/case.py index 6e9f5d3..aeb7350 100644 --- a/backend/app/models/case.py +++ b/backend/app/models/case.py @@ -190,7 +190,7 @@ class CaseICDCode(Base): case: Mapped[Case] = relationship(back_populates="icd_codes") __table_args__ = ( - Index("idx_case", "case_id"), - Index("idx_code", "icd_code"), - Index("idx_haupt", "icd_hauptgruppe"), + Index("idx_icd_case", "case_id"), + Index("idx_icd_code", "icd_code"), + Index("idx_icd_haupt", "icd_hauptgruppe"), ) diff --git a/backend/app/models/user.py b/backend/app/models/user.py index 4ea0609..15910ba 100644 --- a/backend/app/models/user.py +++ b/backend/app/models/user.py @@ -102,8 +102,8 @@ class RefreshToken(Base): user: Mapped[User] = relationship(back_populates="refresh_tokens") __table_args__ = ( - Index("idx_user", "user_id"), - Index("idx_token", "token_hash"), + Index("idx_rt_user", "user_id"), + Index("idx_rt_token", "token_hash"), )