feat: Migrate from custom migrations to goose#11
Merged
eshaffer321 merged 3 commits intomainfrom Jan 3, 2026
Merged
Conversation
cb2a08e to
3e65804
Compare
- Remove accidentally committed monarch_sync.db.backup - Add *.db.backup pattern to .gitignore
Replace the custom migration system with goose library for better maintainability and future seeding support. Key changes: - Add goose v3 dependency for SQL and Go migrations - Convert 6 existing migrations to SQL files in migrations/ directory - Add bridge migration (00007) that handles transition from old system - Detect legacy schema_migrations table and preserve version history - Update tests to verify goose migration behavior Safety features: - Existing databases: Legacy versions are copied to goose_db_version before goose runs, preventing re-execution of already-applied migrations - Fresh databases: All 7 migrations run normally - All existing data is preserved during the transition Benefits: - CLI tools: goose up, goose down, goose status - SQL migrations: Easier to write and review - Seeding support: goose -no-versioning for test data - Down migrations: Proper rollback support
3e65804 to
5d8d799
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Key Changes
github.com/pressly/goose/v3dependencyinternal/infrastructure/storage/migrations/Safety Features
schema_migrationsversions are copied togoose_db_versionbefore goose runs, preventing re-executionTest plan
go test ./...)