Add Exception model
This commit is contained in:
parent
b0def99f22
commit
4c61b7fcfe
18
models/exception.py
Normal file
18
models/exception.py
Normal file
@ -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())
|
Loading…
x
Reference in New Issue
Block a user