macOS ◆ screen-256color ◆ bash 598 views

Run rails migration commands via aliases with auto-completion for version numbers (via fzf)

brew install fzf
curl https://gist.githubusercontent.com/matthutchinson/6c1bc7681b323d4d2ef5d5a55626a5cf/raw > ~/.fzf_migrations
source ~/.fzf_migrations

Then run these commands to migrate:

rdbm  # bundle exec rake db:migrate (no auto-completion)
rdbmu # bundle exec rake db:migrate:up
rdbmd # bundle exec rake db:migrate:down
rdbmr # bundle exec rake db:migrate:redo
  • Read more about fzf
  • I have other useful fuzzy find helpers here (for git, bash etc.)

More by matthutchinson

VideoSnap 01:05

by matthutchinson

See all