fix: match production app config index

This commit is contained in:
zhx 2026-07-10 20:30:30 +08:00
parent b6d240e86f
commit a212d8132d
2 changed files with 5 additions and 4 deletions

View File

@ -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)

View File

@ -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`);