Extract SQLite migrations into separate files (bd-fb95094c.7)

- Created migrations/ subdirectory with 14 individual migration files
- Reduced migrations.go from 680 to 98 lines (orchestration only)
- Updated test imports to use migrations package
- Updated MULTI_REPO_HYDRATION.md documentation
- All tests passing
This commit is contained in:
Steve Yegge
2025-11-06 20:06:38 -08:00
parent 0095464e83
commit b655b29ad9
18 changed files with 642 additions and 624 deletions

View File

@@ -6,6 +6,7 @@ import (
"os"
"testing"
"github.com/steveyegge/beads/internal/storage/sqlite/migrations"
"github.com/steveyegge/beads/internal/types"
)
@@ -51,7 +52,7 @@ func TestMigrateChildCountersTable(t *testing.T) {
}
// Run migration
err = migrateChildCountersTable(db)
err = migrations.MigrateChildCountersTable(db)
if err != nil {
t.Fatalf("migration failed: %v", err)
}
@@ -77,12 +78,12 @@ func TestMigrateChildCountersTable(t *testing.T) {
db := s.db
// Run migration twice
err := migrateChildCountersTable(db)
err := migrations.MigrateChildCountersTable(db)
if err != nil {
t.Fatalf("first migration failed: %v", err)
}
err = migrateChildCountersTable(db)
err = migrations.MigrateChildCountersTable(db)
if err != nil {
t.Fatalf("second migration failed (not idempotent): %v", err)
}