Skip to content

Commit dc28aa6

Browse files
refactor(models): remove IdMixin from ClientTemplate and define primary key directly
1 parent d105bfc commit dc28aa6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

app/db/models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -789,12 +789,13 @@ class CoreConfig(Base, IdMixin, CreatedAtUTCMixin):
789789
fallbacks_inbound_tags: Mapped[Optional[set[str]]] = mapped_column(StringArray(2048), default_factory=set)
790790

791791

792-
class ClientTemplate(Base, IdMixin):
792+
class ClientTemplate(Base):
793793
__tablename__ = "client_templates"
794794
__table_args__ = (
795795
UniqueConstraint("template_type", "name"),
796796
Index("ix_client_templates_template_type", "template_type"),
797797
)
798+
id: Mapped[int] = mapped_column(primary_key=True, init=False, autoincrement=True)
798799
name: Mapped[str] = mapped_column(String(64), nullable=False)
799800
template_type: Mapped[str] = mapped_column(String(32), nullable=False)
800801
content: Mapped[str] = mapped_column(Text, nullable=False)

0 commit comments

Comments
 (0)