Files
zclaw_openfang/crates/zclaw-saas/migrations/20260403000001_accounts_template_assignment.sql
iven ea00c32c08
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
feat(saas): industry agent template assignment system
Phase 1-8 of industry-agent-delivery plan:

- DB migration: accounts.assigned_template_id (ON DELETE SET NULL)
- SaaS API: 4 new endpoints (assign/get/unassign/create-agent)
- Service layer: assign_template_to_account, get_assigned_template, unassign_template, create_agent_from_template)
- Types: AssignTemplateRequest, AgentConfigFromTemplate (capabilities merged into tools)
- Frontend SaaS Client: assignTemplate, getAssignedTemplate, unassignTemplate, createAgentFromTemplate
- saasStore: assignedTemplate state + login auto-fetch + actions
- saas-relay-client: fix unused import and saasUrl reference error
- connectionStore: fix relayModel undefined error
- capabilities default to glm-4-flash

- Route registration: new template assignment routes

Cospec and handlers consolidated

Build: cargo check --workspace PASS, tsc --noEmit Pass
2026-04-03 13:31:58 +08:00

10 lines
426 B
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- Phase 1: accounts 表增加 assigned_template_id
-- 用户选择行业模板后记录分配关系,用于跟踪和跳过 onboarding
-- ON DELETE SET NULL: 模板被删除时不影响账户
ALTER TABLE accounts ADD COLUMN assigned_template_id TEXT
REFERENCES agent_templates(id) ON DELETE SET NULL;
COMMENT ON COLUMN accounts.assigned_template_id IS
'用户选择的行业模板 ID用于跟踪模板分配状态';