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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user