2025-03-30 07:52:46 +00:00

18 lines
697 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(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())