From e00851d7e61421a531f5280dbcec67bbfc699d7e Mon Sep 17 00:00:00 2001 From: easyai Date: Wed, 22 Jul 2026 15:31:14 +0800 Subject: [PATCH] =?UTF-8?q?fix(db):=20=E8=B0=83=E6=95=B4=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E5=85=83=E6=95=B0=E6=8D=AE=E8=BF=81=E7=A7=BB=E4=B8=BA=E5=8F=AF?= =?UTF-8?q?=E7=A9=BA=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 生产迁移安全策略禁止在已有任务表上直接新增非空列。兼容提交响应读取已使用 COALESCE,因此将 JSONB 元数据列改为可空,不改变接口行为。 验证:ci-validate-migrations.mjs;migrations-test.sh;go test ./internal/store ./internal/httpapi。 --- apps/api/migrations/0075_compatibility_protocol_metadata.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/api/migrations/0075_compatibility_protocol_metadata.sql b/apps/api/migrations/0075_compatibility_protocol_metadata.sql index 446a72c..6e65f24 100644 --- a/apps/api/migrations/0075_compatibility_protocol_metadata.sql +++ b/apps/api/migrations/0075_compatibility_protocol_metadata.sql @@ -3,8 +3,8 @@ ALTER TABLE gateway_tasks ADD COLUMN IF NOT EXISTS compatibility_public_id text, ADD COLUMN IF NOT EXISTS compatibility_source_protocol text, ADD COLUMN IF NOT EXISTS compatibility_submit_http_status integer, - ADD COLUMN IF NOT EXISTS compatibility_submit_headers jsonb NOT NULL DEFAULT '{}'::jsonb, - ADD COLUMN IF NOT EXISTS compatibility_submit_body jsonb NOT NULL DEFAULT '{}'::jsonb; + ADD COLUMN IF NOT EXISTS compatibility_submit_headers jsonb, + ADD COLUMN IF NOT EXISTS compatibility_submit_body jsonb; CREATE UNIQUE INDEX IF NOT EXISTS gateway_tasks_compatibility_public_id_unique ON gateway_tasks (compatibility_protocol, compatibility_public_id)