From a212d8132d2b1b89df78732ed95b711f0315ac95 Mon Sep 17 00:00:00 2001 From: zhx Date: Fri, 10 Jul 2026 20:30:30 +0800 Subject: [PATCH] fix: match production app config index --- server/admin/internal/modules/appconfig/service_test.go | 7 ++++--- server/admin/migrations/086_app_config_app_scope.sql | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/server/admin/internal/modules/appconfig/service_test.go b/server/admin/internal/modules/appconfig/service_test.go index 098fa0f7..e378e6b4 100644 --- a/server/admin/internal/modules/appconfig/service_test.go +++ b/server/admin/internal/modules/appconfig/service_test.go @@ -16,9 +16,10 @@ func TestH5AppScopeMigrationKeepsAppAgnosticLegacyBaseline(t *testing.T) { } sqlText := string(body) for _, snippet := range []string{ - "app_code VARCHAR(32) NOT NULL DEFAULT ''", - "is_deleted BOOLEAN NOT NULL DEFAULT FALSE", - "uk_admin_app_config_app_group_key (app_code, `group`, `key`)", + "app_code VARCHAR(32) NOT NULL DEFAULT ''", + "is_deleted BOOLEAN NOT NULL DEFAULT FALSE", + "DROP INDEX uk_admin_app_configs_group_key", + "uk_admin_app_config_app_group_key (app_code, `group`, `key`)", } { if !strings.Contains(sqlText, snippet) { t.Fatalf("h5 app scope migration missing %q", snippet) diff --git a/server/admin/migrations/086_app_config_app_scope.sql b/server/admin/migrations/086_app_config_app_scope.sql index 0f02b786..dae03bfe 100644 --- a/server/admin/migrations/086_app_config_app_scope.sql +++ b/server/admin/migrations/086_app_config_app_scope.sql @@ -6,6 +6,6 @@ SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE admin_app_configs ADD COLUMN app_code VARCHAR(32) NOT NULL DEFAULT '' COMMENT '应用编码;空值仅表示迁移前的只读默认基线' AFTER id, ADD COLUMN is_deleted BOOLEAN NOT NULL DEFAULT FALSE COMMENT '当前 App 删除墓碑;用于屏蔽默认基线' AFTER description, - DROP INDEX idx_admin_app_config_group_key, + DROP INDEX uk_admin_app_configs_group_key, ADD UNIQUE KEY uk_admin_app_config_app_group_key (app_code, `group`, `key`), ADD KEY idx_admin_app_configs_app_group (app_code, `group`);