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

@@ -47,7 +47,7 @@ repos:
**Modified Files:**
- `internal/storage/sqlite/schema.go` - Added `repo_mtimes` table
- `internal/storage/sqlite/migrations.go` - Added migration for `repo_mtimes`
- `internal/storage/sqlite/migrations/013_repo_mtimes_table.go` - Migration for `repo_mtimes` table
- `internal/storage/sqlite/sqlite.go` - Integrated hydration into storage initialization
- `internal/storage/sqlite/ready.go` - Added `source_repo` to all SELECT queries
- `internal/storage/sqlite/labels.go` - Added `source_repo` to SELECT query
@@ -239,8 +239,8 @@ repos:
The `repo_mtimes` table is created via standard migration system:
```go
// internal/storage/sqlite/migrations.go
func migrateRepoMtimesTable(db *sql.DB) error {
// internal/storage/sqlite/migrations/013_repo_mtimes_table.go
func MigrateRepoMtimesTable(db *sql.DB) error {
// Check if table exists
var tableName string
err := db.QueryRow(`