-- 运营中心 · 活动模块(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() );