Files
streamline/drizzle/0027_eddy_releases.sql
T
2026-11-16 17:26:44 -08:00

20 lines
1015 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.
-- Eddy 基线:把「有人跑过这个身份」和「官方发布、可下载」拆成两张表。
-- eddy_baselines 由客户端层登记(POST /api/eddy/baselines/seen,first-seen、不可变);
-- eddy_releases 只由管理员 / 发布流水线写(SSO+admin 或 EDDY_RELEASE_TOKEN),可更新、可下架。
-- 下载地址因此永远不会从客户端层进来:0026 里 eddy_baselines.artifact 是客户端可写的,
-- 谁先 seen 谁就能给一个新构建塞下载地址——这里把那一列删掉。生产库此时该表还是 0 行。
-- 关联只用 baseline_id 字符串,不加外键:发布可能早于任何客户端 seen,也可能晚于。
CREATE TABLE IF NOT EXISTS "eddy_releases" (
"baseline_id" text PRIMARY KEY,
"state" text NOT NULL,
"artifact" text NOT NULL,
"eddy_release" text,
"notes" text,
"published_by" text,
"published_at" bigint NOT NULL,
"updated_at" bigint NOT NULL
);
ALTER TABLE "eddy_baselines" DROP COLUMN IF EXISTS "artifact";