Recommended installation with vundle
:
Plugin 'ThanhKhoaIT/rails-db-migrate.vim'
Add your preferred key mappings to your .vimrc
file.
" rails-db-migrate.vim mappings
map <Leader>dm :RailsMigrate<CR>
map <Leader>dd :RailsMigrateDown<CR>
map <Leader>du :RailsMigrateUp<CR>
map <Leader>dr :RailsMigrateRedo<CR>
Overwrite the g:rails_migrate_command
variable to execute a custom command.
Example: (it is Default)
let g:rails_migrate_command = "!bundle exec rake"
This g:rails_migrate_command
variable can be used to support any number of migration runners or pre-loaders.
For example, to use Dispatch:
let g:rails_migrate_command = "Dispatch bundle exec rake"
Command line: bundle exec rake db:migrate
:RailsMigrate
Command line: bundle exec rake db:migrate:down VERSION={version}
:RailsMigrateDown
Command line: bundle exec rake db:migrate:up VERSION={version}
:RailsMigrateUp
Command line: bundle exec rake db:migrate:redo VERSION={version}
:RailsMigrateRedo