
Lazy Migrate
https://github.com/jesseduffield/lazy_migrate- Category
- Developer Tools
- Rank
- No. 1798Tools index
Previous survey · No. 1807 ·
- Pricing
- Open Source
- Type
- TOOL
- Builder
- jesseduffield
- GitHub
- 211 stars
- Date
About
Terminal UI for managing Rails schema migrations — see what is pending, jump between versions, and re-run with one keystroke.
What it does
This Ruby gem wraps Rails migration operations in an interactive prompt. It lists migration state, exposes common actions, updates the schema dump afterward, and can retimestamp a migration while preserving or rerunning its applied state.
Why it's ranked here
The migration retimestamping workflow solves a specific team pain with useful automation and adapter tests. However, the action prompt references an undefined name, so the repository text indicates the main interactive path can fail before an operation is selected.
What's good
The standout feature coordinates filename retimestamping with the schema migration table. Applied migrations can be moved without rerunning, or taken down and reapplied. Separate adapters handle Rails migration API differences, and tests cover both retimestamping paths.
Tradeoffs
It only handles schema migrations, not data migrations. Its compatibility split is based on a Rails version string comparison, and the code rescues every exception during actions. Most importantly, the action prompt contains an undefined name reference that its tests do not exercise.
How to use it well
Consider it for Rails teams that frequently reorder timestamped schema migrations after branch merges. The retimestamping workflow is the reason to try it. Validate the interactive prompt against your Rails version first, and keep separate tooling for data migrations.
Technical notes+
lib/lazy_migrate/client.rb builds the TTY::Prompt loop and maps migrate, rollback, up, down, redo, and bring-to-top actions, but select_action_prompt interpolates name without defining it; the provided specs do not cover this client path. lib/lazy_migrate/migrator_adapter.rb renames the migration file, optionally runs down and up, updates ActiveRecord::SchemaMigration, and dumps schema.rb when configured. lib/lazy_migrate/migrator_adapter_factory.rb selects OldMigratorAdapter or NewMigratorAdapter using Rails.version > '5.2.0'. spec/lazy_migrate/migrator_adapter_spec.rb exercises migration discovery, filename replacement, retimestamping with and without reruns, schema dumping, and migration operations.
Observed
- License
- MIT License
- Primary language
- Ruby
- Packaging
- Ruby gem installable through a Gemfile or gem install
- Interfaces
- Interactive Rails console entry point and optional Rake task
- Migration scope
- Schema migrations only; Data Migrate integration is not supported
- Typing
- Uses Sorbet runtime types, with strict and untyped files
- Tests
- RSpec suite includes adapter integration coverage with mock Rails applications
Read from README.md, Gemfile, lib/lazy_migrate.rb, lib/lazy_migrate/client.rb, lib/lazy_migrate/version.rb, lib/lazy_migrate/migration.rb, lib/lazy_migrate/migrator_adapter.rb, lib/lazy_migrate/new_migrator_adapter.rb, lib/lazy_migrate/old_migrator_adapter.rb, lib/lazy_migrate/migrator_adapter_factory.rb, spec/spec_helper.rb, spec/rails_helper.rb, spec/lazy_migrate_spec.rb, spec/support/mock_schema.rb, spec/lazy_migrate/migrator_adapter_spec.rb.
What it can do
Display pending Rails migrations
Rails application with migration files → List of pending migrations
Navigate between migration versions
Rails migration history and user selection → Database schema at selected version
Execute migrations with single keystroke
Selected migration and keystroke command → Updated database schema
Re-run existing migrations
Previously executed migration and user command → Re-executed migration with updated database state
Show current migration status
Rails application database state → Current schema version and migration status
Tags
Tech Stack
Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.