Skip to content

Commit

Permalink
fix: updated provider db model to make name unique (keephq#1208)
Browse files Browse the repository at this point in the history
Signed-off-by: Tal <[email protected]>
Co-authored-by: Tal <[email protected]>
  • Loading branch information
pehlicd and talboren authored Jun 5, 2024
1 parent 23e2018 commit 1d31a84
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions keep/api/models/db/provider.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
from datetime import datetime
from typing import Optional

from sqlalchemy import UniqueConstraint
from sqlmodel import JSON, Column, Field, SQLModel


class Provider(SQLModel, table=True):
__table_args__ = (UniqueConstraint("tenant_id", "name"),)

id: str = Field(default=None, primary_key=True)
tenant_id: str = Field(foreign_key="tenant.id")
name: str
Expand Down

0 comments on commit 1d31a84

Please sign in to comment.