About new standalone migration in rails 3.2.x

Hey guys,
I’m new to rails, and I using rails 3.2.8, follow this guide
http://guides.rubyonrails.org/migrations.html#creating-a-standalone-migration,
I type

rails generate migration AddOriginCreatorToTags

in my terminal and got

invoke active_record
create db/migrate/20120820095010_add_original_creator_to_tags.rb

but I can’t find

add_column :tags, :origin_creator, :string

in 20120820095010_add_original_creator_to_tags.rb

On Monday, August 20, 2012 12:21:44 PM UTC+1, Yongning L. wrote:

invoke active_record
create db/migrate/20120820095010_add_original_creator_to_tags.rb

but I can’t find

add_column :tags, :origin_creator, :string

in 20120820095010_add_original_creator_to_tags.rb

It doesn’t infer the columns to add from the migration name - you have
to
specify those . In your case that would be

rails generate migration AddOriginCreatorToTags origin_creator:string

Fred

Thanks Fred, I forgot the

origin_creator:string

在 2012年8月21日星期二UTC+8上午2时49分34秒,Frederick C.写道:

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs