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 AddOriginCreatorToTagsin my terminal and got> invoke active_record > create db/migrate/20120820095010_add_original_creator_to_tags.rbbut I can''t find> add_column :tags, :origin_creator, :stringin 20120820095010_add_original_creator_to_tags.rb -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/2GFhjrEc76cJ. For more options, visit https://groups.google.com/groups/opt_out.
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 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/LxkWDyYCofwJ. For more options, visit https://groups.google.com/groups/opt_out.
Thanks Fred, I forgot the> origin_creator:string在 2012年8月21日星期二UTC+8上午2时49分34秒,Frederick Cheung写道:> > 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 >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/3VGn038yCiUJ. For more options, visit https://groups.google.com/groups/opt_out.