From 0cfe741553a8484fce6c662087f65cc168ec289b Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Sun, 2 Nov 2025 12:55:53 -0800 Subject: [PATCH] Fix config version update in migrate command - Save updated config with current version (fixes GH #193) - Update version field when loading existing config - Database version now stays in sync with binary version Amp-Thread-ID: https://ampcode.com/threads/T-dfacc972-f6c8-4bb3-8997-faa079b5d070 Co-authored-by: Amp --- .beads/config.json | 2 +- cmd/bd/migrate.go | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.beads/config.json b/.beads/config.json index a57a1287..b1d2fd2f 100644 --- a/.beads/config.json +++ b/.beads/config.json @@ -1,5 +1,5 @@ { "database": "beads.db", - "version": "0.21.0", + "version": "0.21.3", "jsonl_export": "beads.jsonl" } \ No newline at end of file diff --git a/cmd/bd/migrate.go b/cmd/bd/migrate.go index d7f8dd0c..5ca7d322 100644 --- a/cmd/bd/migrate.go +++ b/cmd/bd/migrate.go @@ -440,6 +440,16 @@ This command: } } + // Save updated config with current version (fixes GH #193) + if !dryRun { + if err := cfg.Save(beadsDir); err != nil { + if !jsonOutput { + color.Yellow("Warning: failed to update config.json version: %v\n", err) + } + // Don't fail migration if config save fails + } + } + // Final status if jsonOutput { outputJSON(map[string]interface{}{ @@ -667,6 +677,9 @@ func loadOrCreateConfig(beadsDir string) (*configfile.Config, error) { // Create default if no config exists if cfg == nil { cfg = configfile.DefaultConfig(Version) + } else { + // Update version field in existing config (fixes GH #193) + cfg.Version = Version } return cfg, nil