Initial import of streamline
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
-- Ideas:大家愿意公开的「想法 demo」墙(shared/src/ideas.ts)。
|
||||
--
|
||||
-- 一行 = 一条公开的想法。来源三种:feature / bug(Streamline 单子,关注人或管理员手动发布)
|
||||
-- 和 eddy(Eddy 任务,作者在 Eddy 里发布,截图 / 录屏 / 代码包转存在 TOS 的 ideas/ 前缀下)。
|
||||
-- 同一来源只保留一条(重复发布 = 更新),撤回 = 删行,原单子不受影响。
|
||||
-- media 是 JSON 数组 [{type:"image"|"video", url}],第一项是封面。
|
||||
--
|
||||
-- 只建新表(ideas / idea_likes / feature_relays),不动已有表:先跑迁移再上代码即可,反过来也只是 Ideas 页报错,不影响看板。
|
||||
CREATE TABLE IF NOT EXISTS "ideas" (
|
||||
"id" text PRIMARY KEY,
|
||||
"source" text NOT NULL,
|
||||
"source_id" text NOT NULL,
|
||||
"title" text NOT NULL,
|
||||
"summary" text NOT NULL DEFAULT '',
|
||||
"platform" text,
|
||||
"media" text NOT NULL DEFAULT '[]',
|
||||
"author" text NOT NULL,
|
||||
"published_by" text NOT NULL,
|
||||
"bundle_url" text,
|
||||
"created_at" bigint NOT NULL,
|
||||
"updated_at" bigint NOT NULL
|
||||
);
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS ideas_source_uidx ON "ideas" ("source", "source_id");
|
||||
CREATE INDEX IF NOT EXISTS ideas_created_at_idx ON "ideas" ("created_at");
|
||||
|
||||
-- 点赞:一人一条,取消 = 删行。想法撤回时一起删。
|
||||
CREATE TABLE IF NOT EXISTS "idea_likes" (
|
||||
"idea_id" text NOT NULL,
|
||||
"email" text NOT NULL,
|
||||
"created_at" bigint NOT NULL,
|
||||
PRIMARY KEY ("idea_id", "email")
|
||||
);
|
||||
|
||||
-- Streamline 接力:从 Ideas 把别人的 Feature 复制一张到自己名下(新单以对方已推送的分支为基线,
|
||||
-- 走正常的评估 → 待确认,确认后出新的 MR)。这里记新单是从谁的哪一版接力来的,详情里关注人处展示。
|
||||
CREATE TABLE IF NOT EXISTS "feature_relays" (
|
||||
"feature_id" text PRIMARY KEY,
|
||||
"source_kind" text NOT NULL,
|
||||
"source_id" text NOT NULL,
|
||||
"source_round" integer NOT NULL DEFAULT 1,
|
||||
"source_owner" text NOT NULL,
|
||||
"idea_id" text,
|
||||
"created_by" text NOT NULL,
|
||||
"created_at" bigint NOT NULL
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS feature_relays_source_idx ON "feature_relays" ("source_id");
|
||||
Reference in New Issue
Block a user