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())