From e7b70c24f8a456ccb6741f6808c405e2b8af480a Mon Sep 17 00:00:00 2001 From: weichen Date: Mon, 12 Oct 2026 05:04:16 +0000 Subject: [PATCH] Renumber agent_system_identity to v27 after login_keys took v26 Why: main #171 claimed migration v26; rebase conflict required bumping the U1 I3 table and completing copyOrder for both new tables. Evidence: go test ./internal/store/ ./cmd/storage-migrate/ -run 'SystemIdentity|CopyOrder' Impact: migrate v27; copyOrder += login_keys + agent_system_identity. Refs: Backend PR #170; conflict with main 1d9e8f4 Co-authored-by: Cursor --- cmd/storage-migrate/main.go | 2 ++ internal/store/system_identity_test.go | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/storage-migrate/main.go b/cmd/storage-migrate/main.go index bb4eb45..cfee408 100644 --- a/cmd/storage-migrate/main.go +++ b/cmd/storage-migrate/main.go @@ -291,6 +291,8 @@ var copyOrder = []string{ "secret_keys", "settings_snapshots", "regen_pending", "context_entries", "user_commands", "pending_notices", "recovery_holds", "surfaces", "surface_revisions", "surface_actions", "plugin_activation", + // v26 login_keys(#171 合入 main 时漏登记;本 PR 一并补齐) + "login_keys", // U1 I3:服务实例 DB 身份(无外键;迁移须保留以免目标库丢锚) "agent_system_identity", } diff --git a/internal/store/system_identity_test.go b/internal/store/system_identity_test.go index e9a61e0..f0b4f6e 100644 --- a/internal/store/system_identity_test.go +++ b/internal/store/system_identity_test.go @@ -55,13 +55,13 @@ func TestSystemIdentityMigrationCreatesTable(t *testing.T) { } found := false for _, v := range versions { - if v == 26 { + if v == 27 { found = true break } } if !found { - t.Fatalf("migration v26 not applied: %v", versions) + t.Fatalf("migration v27 not applied: %v", versions) } var name string if err := st.DB().QueryRow(`SELECT name FROM sqlite_master WHERE type='table' AND name='agent_system_identity'`).Scan(&name); err != nil || name != "agent_system_identity" {