- New pages: DigitalEmployeeFactory.vue (goal grid + create dialog), GoalDetail.vue (task tree + progress) - New store: goal.ts (Pinia store with full Goal/Task API bindings) - Router: add /digital-employees and /goals/:id routes - MainLayout: add "数字员工工厂" nav menu item with UserFilled icon - Schedule model: add schedule_type, goal_id, goal_config for Goal-type cron scheduling - Schedule service: add _create_execution_for_goal_schedule for periodic Goal creation - Migration 014: add schedule_type/goal_id/goal_config columns to agent_schedules Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
31 lines
1.3 KiB
Python
31 lines
1.3 KiB
Python
"""add schedule_type, goal_id, goal_config to agent_schedules
|
|
|
|
Revision ID: 014_add_schedule_goal_fields
|
|
Revises: 013_add_goals_tasks
|
|
Create Date: 2026-05-08
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
from sqlalchemy.dialects.mysql import CHAR
|
|
|
|
revision = "014_add_schedule_goal_fields"
|
|
down_revision = "013_add_goals_tasks"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.add_column("agent_schedules", sa.Column("schedule_type", sa.String(20), default="agent", comment="调度类型: agent / goal"))
|
|
op.add_column("agent_schedules", sa.Column("goal_id", CHAR(36), sa.ForeignKey("goals.id"), nullable=True, comment="关联 Goal ID"))
|
|
op.add_column("agent_schedules", sa.Column("goal_config", sa.JSON, nullable=True, comment="Goal 调度配置"))
|
|
op.create_index("ix_agent_schedules_goal_id", "agent_schedules", ["goal_id"])
|
|
op.alter_column("agent_schedules", "agent_id", existing_type=CHAR(36), nullable=True)
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.drop_index("ix_agent_schedules_goal_id", table_name="agent_schedules")
|
|
op.drop_column("agent_schedules", "goal_config")
|
|
op.drop_column("agent_schedules", "goal_id")
|
|
op.drop_column("agent_schedules", "schedule_type")
|
|
op.alter_column("agent_schedules", "agent_id", existing_type=CHAR(36), nullable=False)
|