Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

With Vim Rails, can you create a new migration file and open it in one go?

Tags:

vim

ruby

textmate

Using vim with the Rails plugin, can you create a migration file and then open the file in one go?

Was this possible with textmate also?

like image 872
Blankman Avatar asked Oct 22 '11 03:10

Blankman


People also ask

How do I run a specific migration in rails?

How do I run a specific migration in rails? To run a specific migration up or down, use db:migrate:up or db:migrate:down . The version number in the above commands is the numeric prefix in the migration's filename. For example, to migrate to the migration 20160515085959_add_name_to_users.

How do I roll back migration in rails?

To check for status, run rails db:migrate:status . Then you'll have a good view of the migrations you want to remove. Then, run rails db:rollback to revert the changes one by one. After doing so, you can check the status again to be fully confident.

How does rails migration work?

A Rails migration is a tool for changing an application's database schema. Instead of managing SQL scripts, you define database changes in a domain-specific language (DSL). The code is database-independent, so you can easily move your app to a new platform.


1 Answers

You could use rails.vim and then do something like:

:Rgenerate migraton add_foo_to_bar

The plugin will open the migration generated file, that's exactly what you want. I can't speak for textmate.

like image 123
lucapette Avatar answered Sep 23 '22 12:09

lucapette