Stand up DB migrations now that the app is mature enough#229
Merged
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the database migration system from a simple auto-migration approach to a version-based migration runner with explicit migration tracking. The changes establish a more mature migration framework with version control, rollback capabilities, and migration history tracking through a schema_versions table.
Key Changes:
- Replaced GORM's AutoMigrate with a custom migration runner that tracks versions
- Introduced a migration registry system with init-time registration
- Added support for up/down migrations and rollback functionality
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| apiserver/main.go | Updated to use new migration runner API instead of old migration utility |
| apiserver/internal/utils/test/database.go | Updated test setup to use new migration runner |
| apiserver/internal/utils/migration/migration_test.go | Removed - old migration test file deleted |
| apiserver/internal/utils/migration/migration.go | Removed - old AutoMigrate-based migration system deleted |
| apiserver/internal/migrations/runner.go | New migration runner with version tracking, up/down migration support, and status checking |
| apiserver/internal/migrations/migration.go | New migration registry and interface definitions for version-based migrations |
| apiserver/internal/migrations/base.go | Removed - old migration base implementation deleted |
| apiserver/internal/migrations/001_initial_schema.go | New initial schema migration implementing the Migration interface |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.