From 33a4d25ca9bd57499d4a647f72bae7461aefd5bf Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 20 Apr 2026 15:29:25 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=96=B0=E5=A2=9E=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E8=BF=81=E7=A7=BB=EF=BC=8C=E5=B0=86=E5=AE=9E=E5=90=8D?= =?UTF-8?q?=E8=AE=A4=E8=AF=81=E7=AD=96=E7=95=A5=E9=BB=98=E8=AE=A4=E5=80=BC?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=20after=5Forder?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- ...realname_policy_default_to_after_order.down.sql | 13 +++++++++++++ ...e_realname_policy_default_to_after_order.up.sql | 14 ++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 migrations/000130_change_realname_policy_default_to_after_order.down.sql create mode 100644 migrations/000130_change_realname_policy_default_to_after_order.up.sql diff --git a/migrations/000130_change_realname_policy_default_to_after_order.down.sql b/migrations/000130_change_realname_policy_default_to_after_order.down.sql new file mode 100644 index 0000000..7fbdbb6 --- /dev/null +++ b/migrations/000130_change_realname_policy_default_to_after_order.down.sql @@ -0,0 +1,13 @@ +-- 回滚:将实名认证策略的列默认值恢复为 none(无需实名) + +ALTER TABLE tb_iot_card + ALTER COLUMN realname_policy SET DEFAULT 'none'; + +ALTER TABLE tb_device + ALTER COLUMN realname_policy SET DEFAULT 'none'; + +ALTER TABLE tb_iot_card_import_task + ALTER COLUMN realname_policy SET DEFAULT 'none'; + +ALTER TABLE tb_device_import_task + ALTER COLUMN realname_policy SET DEFAULT 'none'; diff --git a/migrations/000130_change_realname_policy_default_to_after_order.up.sql b/migrations/000130_change_realname_policy_default_to_after_order.up.sql new file mode 100644 index 0000000..dd0d793 --- /dev/null +++ b/migrations/000130_change_realname_policy_default_to_after_order.up.sql @@ -0,0 +1,14 @@ +-- 将实名认证策略的列默认值从 none 改为 after_order(先充值/购买后实名) +-- 仅影响新增记录,现有记录保持原有值不变 + +ALTER TABLE tb_iot_card + ALTER COLUMN realname_policy SET DEFAULT 'after_order'; + +ALTER TABLE tb_device + ALTER COLUMN realname_policy SET DEFAULT 'after_order'; + +ALTER TABLE tb_iot_card_import_task + ALTER COLUMN realname_policy SET DEFAULT 'after_order'; + +ALTER TABLE tb_device_import_task + ALTER COLUMN realname_policy SET DEFAULT 'after_order';