ecommerce-7runez/models/exception.py
2025-03-29 22:41:01 +00:00

17 lines
689 B
Python

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, nullable=False, index=True)
error_message = Column(Text, nullable=False)
stack_trace = Column(Text, nullable=True)
endpoint = Column(String, 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())