Add bd migrate command for database upgrades (bd-164)

- Implement bd migrate command with detection, version checking, and cleanup
- Update daemon to suggest bd migrate for version mismatches
- Enhance CLI version warnings to recommend bd migrate
- Add comprehensive tests for migration scenarios
- Document migration workflow in QUICKSTART.md and AGENTS.md

Completes bd-164 and epic bd-159

Amp-Thread-ID: https://ampcode.com/threads/T-34ea4682-8c48-44c2-8421-dc40f867773b
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Steve Yegge
2025-10-26 19:20:39 -07:00
parent 5cede5e84d
commit 7591a3bf81
6 changed files with 522 additions and 3 deletions

View File

@@ -1032,7 +1032,8 @@ func checkVersionMismatch() {
} else if cmp > 0 {
// Binary is newer than database
fmt.Fprintf(os.Stderr, "%s\n", yellow("⚠️ Your binary appears NEWER than the database."))
fmt.Fprintf(os.Stderr, "%s\n\n", yellow("⚠️ The database will be upgraded automatically."))
fmt.Fprintf(os.Stderr, "%s\n", yellow("⚠️ Run 'bd migrate' to check for and migrate old database files."))
fmt.Fprintf(os.Stderr, "%s\n\n", yellow("⚠️ The current database version will be updated automatically."))
// Update stored version to current
_ = store.SetMetadata(ctx, "bd_version", Version)
}