feat: AI Worker 平台 MVP v1.0.0 - 多租户/项目管理/AI Worker/任务编排/HITL审核/成本治理
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
"""Base model and common mixins."""
|
||||
from datetime import datetime
|
||||
from sqlalchemy import Column, Integer, DateTime, String
|
||||
from app.database import Base
|
||||
|
||||
|
||||
class TimestampMixin:
|
||||
"""Adds created_at and updated_at columns."""
|
||||
created_at = Column(DateTime, default=datetime.utcnow, nullable=False)
|
||||
updated_at = Column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow, nullable=False)
|
||||
|
||||
|
||||
class TenantMixin:
|
||||
"""Adds tenant_id column for multi-tenant isolation.
|
||||
|
||||
Every domain model inherits this to guarantee row-level tenant isolation.
|
||||
Queries must always filter by tenant_id.
|
||||
"""
|
||||
tenant_id = Column(Integer, nullable=False, index=True)
|
||||
Reference in New Issue
Block a user