feat: deliver agent foundation day 1
This commit is contained in:
25
server/src/app/models/audit_log.py
Normal file
25
server/src/app/models/audit_log.py
Normal file
@@ -0,0 +1,25 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import uuid
|
||||
from datetime import datetime
|
||||
from typing import Any
|
||||
|
||||
from sqlalchemy import DateTime, String, func
|
||||
from sqlalchemy.orm import Mapped, mapped_column
|
||||
from sqlalchemy.types import JSON
|
||||
|
||||
from app.db.base_class import Base
|
||||
|
||||
|
||||
class AuditLog(Base):
|
||||
__tablename__ = "audit_logs"
|
||||
|
||||
id: Mapped[str] = mapped_column(String(36), primary_key=True, default=lambda: str(uuid.uuid4()))
|
||||
actor: Mapped[str] = mapped_column(String(100))
|
||||
action: Mapped[str] = mapped_column(String(100), index=True)
|
||||
resource_type: Mapped[str] = mapped_column(String(50), index=True)
|
||||
resource_id: Mapped[str] = mapped_column(String(100), index=True)
|
||||
before_json: Mapped[dict[str, Any] | None] = mapped_column(JSON, nullable=True)
|
||||
after_json: Mapped[dict[str, Any] | None] = mapped_column(JSON, nullable=True)
|
||||
request_id: Mapped[str] = mapped_column(String(64), index=True)
|
||||
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now())
|
||||
Reference in New Issue
Block a user