-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Add database migrations for smooth version upgrades #344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Implements a comprehensive database migration system to ensure smooth CLI version upgrades without breaking existing databases. **Migration Infrastructure:** - Migration runner with version tracking - Transaction-based migrations (atomic all-or-nothing) - schema_migrations table for tracking applied migrations - Support for SQLite and PostgreSQL backends **Database-Specific Migrations:** - SQLite migration files with initial schema (migration 001) - PostgreSQL migration files with initial schema (migration 001) - Automatic migration on database initialization **CLI Integration:** - `infer migrate` command to run pending migrations - `infer migrate --status` to show migration status - `infer init --overwrite` now runs migrations automatically - `--skip-migrations` flag to opt-out of migrations **Testing & Documentation:** - Comprehensive unit tests (6 test cases, all passing) - Complete documentation in docs/database-migrations.md - Upgrade guide, troubleshooting, and best practices Migrations are applied automatically when: 1. First time initialization (infer init) 2. Connecting to database for the first time 3. Upgrading to a new CLI version with schema changes Fixes #340 Co-authored-by: Eden Reich <[email protected]>
|
@claude Fix the CI |
|
Claude finished @edenreich's task in 3m 59s —— View job CI Fixes Complete ✅Todo List
SummarySuccessfully fixed all CI failures in the database migrations PR! Issues Fixed:
Verification:
The CI should now pass on the next run! |
- Add error checking for cleanup functions in migration tests - Fix markdown linting issues in database-migrations.md - Add skip-migrations flag to init tests to prevent nil viper access Co-authored-by: Eden Reich <[email protected]>
|
@claude CI is still failing, use |
|
Claude finished @edenreich's task in 4m 48s —— View job CI Fixes Complete ✅Todo List
SummarySuccessfully fixed the CI failure by applying proper Go formatting to Issue: The CI was failing because Fix Applied: Ran
The CI should now pass on the next run! View PR | Latest commit | |
Fix map alignment formatting to match go fmt standards. Co-authored-by: Eden Reich <[email protected]>
…y or jsonl storage types Signed-off-by: Eden Reich <[email protected]>
Signed-off-by: Eden Reich <[email protected]>
|
🎉 This PR is included in version 0.93.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
Implements a comprehensive database migration system to ensure smooth CLI version upgrades without breaking existing databases.
Key Features
schema_migrationstableinfer migratecommand with status checkinginfer init --overwriteChanges
internal/infra/storage/migrations/infer migratecommand for manual migration controldocs/database-migrations.mdTesting
Fixes #340
🤖 Generated with Claude Code