From 17fe835107434b3d2f18be29e5958f8b9290359f Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Sun, 30 Mar 2025 07:52:46 +0000 Subject: [PATCH] Add Exception model --- models/exception.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 models/exception.py diff --git a/models/exception.py b/models/exception.py new file mode 100644 index 0000000..4b85341 --- /dev/null +++ b/models/exception.py @@ -0,0 +1,18 @@ +from sqlalchemy import Column, String, DateTime, Text +from sqlalchemy.dialects.postgresql import UUID +from sqlalchemy.sql import func +from core.database import Base +import uuid + +class Exception(Base): + __tablename__ = "exceptions" + + id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4) + error_code = Column(String(50), nullable=False, index=True) + message = Column(String(255), nullable=False) + details = Column(Text, nullable=True) + stack_trace = Column(Text, nullable=True) + source = Column(String(100), nullable=False) + + created_at = Column(DateTime, default=func.now()) + updated_at = Column(DateTime, default=func.now(), onupdate=func.now()) \ No newline at end of file