Re: About new standalone migration in rails 3.2.x

31 views
Skip to first unread message

Frederick Cheung

unread,
Aug 20, 2012, 2:49:34 PM8/20/12
to rubyonra...@googlegroups.com
On Monday, August 20, 2012 12:21:44 PM UTC+1, Yongning Liang wrote:
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


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

Yongning Liang

unread,
Aug 20, 2012, 10:42:29 PM8/20/12
to rubyonra...@googlegroups.com
Thanks Fred, I forgot the 
origin_creator:string


在 2012年8月21日星期二UTC+8上午2时49分34秒,Frederick Cheung写道:
Reply all
Reply to author
Forward
0 new messages