Files
SupplierSystem/migrations/20261066_quote_sheet_idempotency.sql
Ubuntu 9922d20240
CI / server typecheck + tests (push) Canceled after 0s
CI / web typecheck + tests + miniprogram syntax (push) Canceled after 0s
CI / eslint (观察项,C7 骨架) (push) Canceled after 0s
CI / npm audit (critical 硬拦) (push) Canceled after 0s
feat(报价单): 批量建单返回失败清单(b) + Idempotency-Key 幂等去重(c)(红队 #4)
2026-10-19 18:01:13 +08:00

14 lines
639 B
SQL
Raw Permalink 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.
-- 报价单批量建单的幂等键(2026-10-19 开发者裁决 (c))
-- 目的:勾 N 个客户一次新建 N 张,客户端重试/双击时用同一 Idempotency-Key 直接返回上次结果,不重复建单。
-- 纪律:只做 DDL;不含数据修复。
CREATE TABLE IF NOT EXISTS public.quote_sheet_idempotency (
branch_code text NOT NULL,
idem_key text NOT NULL,
request_hash text NOT NULL,
response_json jsonb,
created_at timestamptz NOT NULL DEFAULT now(),
PRIMARY KEY (branch_code, idem_key)
);
CREATE INDEX IF NOT EXISTS idx_quote_sheet_idempotency_created_at
ON public.quote_sheet_idempotency (created_at);