From 0bf08babc7e3daa64e4b48a8748fdddb0c7146f4 Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Sat, 29 Mar 2025 22:19:45 +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..def5b05 --- /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) + error_message = Column(String(255), nullable=False) + stack_trace = Column(Text, nullable=True) + endpoint = Column(String(100), nullable=False) + method = Column(String(10), nullable=False) + request_data = Column(Text, nullable=True) + created_at = Column(DateTime, default=func.now()) + updated_at = Column(DateTime, default=func.now(), onupdate=func.now()) \ No newline at end of file