Add unique constraint for session id

This commit is contained in:
2025-11-20 23:29:56 +07:00
parent 6691a1a98e
commit f2fca50d5a
3 changed files with 61 additions and 1 deletions

View File

@@ -7,7 +7,7 @@ class CallEvent(Base):
__tablename__ = "call_events"
id = Column(PG_UUID(as_uuid=True), primary_key=True, default=uuid.uuid4, index=True)
call_session_id = Column(BigInteger, nullable=False, index=True)
call_session_id = Column(BigInteger, nullable=False, unique=True, index=True)
direction = Column(String, nullable=False)
notification_mnemonic = Column(String, nullable=False)
last_answered_employee_full_name = Column(String, nullable=True)