fix(admin): use existing app config index in migration

This commit is contained in:
zhx 2026-07-14 10:53:13 +08:00
parent 2f9f37f799
commit 2d925fb68f
2 changed files with 2 additions and 2 deletions

View File

@ -18,7 +18,7 @@ func TestH5AppScopeSchemaMigrationCreatesScopedKeys(t *testing.T) {
for _, snippet := range []string{
"app_code VARCHAR(32) NOT NULL DEFAULT ''",
"is_deleted BOOLEAN NOT NULL DEFAULT FALSE",
"DROP INDEX uk_admin_app_configs_group_key",
"DROP INDEX idx_admin_app_config_group_key",
"uk_admin_app_config_app_group_key (app_code, `group`, `key`)",
} {
if !strings.Contains(sqlText, 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 uk_admin_app_configs_group_key,
DROP INDEX idx_admin_app_config_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`);