From 7c50d259b04d8062d45d48a595c08f20dee09790 Mon Sep 17 00:00:00 2001 From: Vladimir Filonov Date: Sun, 24 Nov 2024 20:41:40 +0400 Subject: [PATCH] LastAlert.tenant_id should be primary key not only in migration --- keep/api/models/db/alert.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keep/api/models/db/alert.py b/keep/api/models/db/alert.py index a31a3089b..c71562945 100644 --- a/keep/api/models/db/alert.py +++ b/keep/api/models/db/alert.py @@ -75,7 +75,7 @@ class AlertToIncident(SQLModel, table=True): class LastAlert(SQLModel, table=True): - tenant_id: str = Field(foreign_key="tenant.id", nullable=False) + tenant_id: str = Field(foreign_key="tenant.id", nullable=False, primary_key=True) fingerprint: str = Field(primary_key=True) alert_id: UUID = Field(foreign_key="alert.id") timestamp: datetime = Field(nullable=False, index=True)