Files
junhong_cmp_fiber/migrations/000258_allow_zero_refund_attempt_amount.down.sql
邹进 c9e5d65590
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 8m16s
fix: 退款审批尝试金额约束允许 0 元
000218 的 chk_refund_request_attempt_amount 要求 refund_amount > 0,0 元退款提交审批报 SQLSTATE 23514。
生产库已人工放宽为 >= 0 但无迁移记录,测试库与新建库仍为 > 0。新增 000258 统一为 >= 0,生产执行后不变。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 15:52:09 +09:00

5 lines
396 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.
-- 恢复为 refund_amount > 0。已存在 0 元审批尝试时不校验存量(NOT VALID),只约束之后写入的数据。
ALTER TABLE tb_refund_request_attempt DROP CONSTRAINT IF EXISTS chk_refund_request_attempt_amount;
ALTER TABLE tb_refund_request_attempt
ADD CONSTRAINT chk_refund_request_attempt_amount CHECK (refund_amount > 0 AND frozen_actual_received_amount >= 0) NOT VALID;