Files
junhong_cmp_fiber/migrations/000258_allow_zero_refund_attempt_amount.up.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

7 lines
631 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.
-- 允许 0 元退款的审批尝试金额(restore-zero-amount-refund)。
-- 背景:000218 建表时约束为 refund_amount > 0,0 元退款(仅作废权益不退钱)提交审批时报 SQLSTATE 23514;
-- 生产库已人工放宽为 >= 0 但没有迁移记录,测试库与新建库仍为 > 0。本迁移把约束统一为 >= 0,生产执行后结果不变。
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);