Skip to content

Commit

Permalink
fix(db): change uniqueness in Presets
Browse files Browse the repository at this point in the history
  • Loading branch information
talboren committed Apr 18, 2024
1 parent b500475 commit 86fa221
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion keep/api/models/db/preset.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
from uuid import UUID, uuid4
from typing import Optional
from uuid import UUID, uuid4

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


class Preset(SQLModel, table=True):
__table_args__ = (UniqueConstraint("tenant_id", "name"),)
# Unique ID for each preset
id: UUID = Field(default_factory=uuid4, primary_key=True)

Expand Down

0 comments on commit 86fa221

Please sign in to comment.