Add Exception model
This commit is contained in:
parent
f5969c704e
commit
17fe835107
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)
|
||||||
|
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())
|
Loading…
x
Reference in New Issue
Block a user