Rails 3 generates migration - not up or down

Just by studying the rails, I move on to migration, and it all started off quite logically until I hit something strange in the code;

rails generate migration AddRegionToSupplier

The above migration file contains only the "def change" method.

I looked for it and found that this is exactly what should happen,

http://guides.rubyonrails.org/migrations.html

I would expect it to generate the def up and def down methods so that the migration can be canceled. Am I doing something wrong in the generation, or am I missing something obvious?

+5
source share
1 answer

From which you inserted :

Rails 3.1 , change. ( ). , , .

, , , def self.down, Rails , , .

+16

All Articles