mirror of
https://github.com/complexcaresolutions/dak.c2s.git
synced 2026-03-17 14:53:41 +00:00
fix: make index names unique across tables for PostgreSQL compatibility
PostgreSQL requires globally unique index names (unlike MySQL which scopes them per table). Prefix generic names: idx_user→idx_al_user/idx_rt_user, idx_token→idx_rt_token, idx_case/idx_code/idx_haupt→idx_icd_*. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
e9eb98119f
commit
83bc1f5865
3 changed files with 8 additions and 8 deletions
|
|
@ -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"),
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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"),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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"),
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue