diff --git a/models/exception.py b/models/exception.py new file mode 100644 index 0000000..8ce28dc --- /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) + endpoint = Column(String, nullable=False) + method = Column(String, nullable=False) + status_code = Column(String, nullable=False) + error_message = Column(Text, nullable=True) + stack_trace = Column(Text, nullable=True) + 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