From 74ef817c41476c42457aef77d74239225244272c Mon Sep 17 00:00:00 2001 From: yml2213 Date: Tue, 8 Sep 2026 13:30:52 +0800 Subject: [PATCH] =?UTF-8?q?fix(migration):=20=E4=BF=AE=E5=A4=8D=20000070?= =?UTF-8?q?=20=E4=B8=AD=20wallet=5Faccounts=20=E5=94=AF=E4=B8=80=E7=B4=A2?= =?UTF-8?q?=E5=BC=95=E5=8D=95=E5=88=97=E6=AE=8B=E5=AD=98=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=9A=84=E5=A4=8D=E5=90=88=E7=B4=A2=E5=BC=95=E7=BC=BA=E5=A4=B1?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../000070_distribution_chat_wallet_isolation.sql | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/backend/migrations/000070_distribution_chat_wallet_isolation.sql b/backend/migrations/000070_distribution_chat_wallet_isolation.sql index be2d36e..a447d6c 100644 --- a/backend/migrations/000070_distribution_chat_wallet_isolation.sql +++ b/backend/migrations/000070_distribution_chat_wallet_isolation.sql @@ -38,6 +38,15 @@ PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt; +SET @sql = IF( + (SELECT COUNT(*) FROM information_schema.STATISTICS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'wallet_accounts' AND INDEX_NAME = 'uk_wallet_accounts_user_site') = 1, + 'ALTER TABLE wallet_accounts DROP KEY uk_wallet_accounts_user_site', + 'SELECT 1' +); +PREPARE stmt FROM @sql; +EXECUTE stmt; +DEALLOCATE PREPARE stmt; + SET @sql = IF( (SELECT COUNT(*) FROM information_schema.STATISTICS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'wallet_accounts' AND INDEX_NAME = 'uk_wallet_accounts_user_site') = 0, 'ALTER TABLE wallet_accounts ADD UNIQUE KEY uk_wallet_accounts_user_site (user_id, distribution_site_id)',