This repository has been archived on 2026-09-13. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
BPOS-TMP-REPO/db/migrations/0035_activity_ops.sql
xcsandClaude Fable 5 0923fbfe4d feat(ops): 运营中心 · 活动模块接口落地 —— L1/L2/L3 十一条(全 ops)+ 设计端活动库两条改名让位
`apps/api/src/app/activity-ops/*`(service / store / instance-state / instance-steps / launch-params /
summaries / view-html / view-scope)+ `routes/activities.ts`;契约 `activity-ops.ts` / `api/activity-ops.ts`
(与队友按文档补的那版 43 个导出同名,多 INSTANCE_REASON_KINDS / STEP_RESULTS / launchOptionSchema);
迁移 0035_activity_ops;《API文档-活动模块》按契约回写。
设计端活动库 GET/POST `/api/gov/activities` 改名 `/api/gov/activity-packages`,`/api/gov/activities/*`
整个让给运营端(前端 import 路由对象,零改动);activity-registry CONTRACT.md 与路由总表同步。
2026-08-27 另一会话做的,一直留在工作树没入库;与同批另两条提交互相依赖,以合并提交为验证单位。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0167qWjeyBwvfdGovd7FWbCu
2026-08-27 23:20:15 +08:00

23 lines
986 B
SQL

-- 运营中心 · 活动模块(2026-08-27)
-- 启动幂等(idempotencyKey):同一枚键只起一单;task_id 为空 = 正在创建(60 秒后可被重占)。
-- 这一行同时是「手动启动 · 谁」的事实来源(实例详情的 input.source)。
create table if not exists sys.activity_launch (
key text primary key,
activity_id text not null,
owner_id text not null,
launched_by text not null,
task_id text,
claimed_at timestamptz not null default now()
);
create unique index if not exists activity_launch_task_key on sys.activity_launch (task_id) where task_id is not null;
-- 运营侧活动档案:负责人 / 说明 / 图标 / 色相(用户定:活动包本身不载这些;seed 给三个真包填上)
create table if not exists sys.activity_profile (
activity_id text primary key,
owner_id text,
description text not null default '',
ico text,
hue text,
updated_at timestamptz not null default now()
);