Files
company-ai-platform/app/tools/init_db.py
JiuContinent 0a153b264a ```
refactor: 移除审批和回写功能模块

移除了整个审批(approvals)和官方回写(writebacks)功能模块,
包括相关模型、路由、服务和配置项。更新了数据库迁移文件,
删除了相关的审批请求表和官方回写运行表。同时从API路由器中
移除了相应的路由,并调整了安全常量和字段验证器以匹配变更。
```
2026-07-08 17:08:59 +08:00

55 lines
1.0 KiB
Python

from app.core.database import Base, engine
from app.modules.audit.models import AuditLog
from app.modules.business.models import (
AttendanceRecord,
Expense,
FundAccount,
LegacySyncRun,
PerformanceMetric,
Policy,
Procurement,
Project,
ReportPushRun,
RiskEvent,
RiskEventAction,
Standard,
Supplier,
WorkReport,
WorkTask,
)
from app.modules.feishu.models import FeishuEventReceipt
from app.modules.events.models import DomainEvent
from app.modules.workflows.models import WorkflowAction, WorkflowInstance
_MODELS = [
AuditLog,
FeishuEventReceipt,
Project,
WorkTask,
Procurement,
Expense,
FundAccount,
Policy,
Standard,
PerformanceMetric,
Supplier,
AttendanceRecord,
WorkReport,
RiskEvent,
RiskEventAction,
LegacySyncRun,
ReportPushRun,
DomainEvent,
WorkflowInstance,
WorkflowAction,
]
def main() -> None:
Base.metadata.create_all(bind=engine)
print("Database schema initialized.")
if __name__ == "__main__":
main()