ROR 3, Ruby 1.9.2 Every time I use migration with add_index included, I get an "Invalid date" error I''m using windows 7 and Mysql2 Can anyone help? Here''s my code: --------------------------------------------------------------------- class CreatePages < ActiveRecord::Migration def self.up create_table :pages do |t| t.integer "subject_id" # can also use: t.references :subject t.string "name" t.string "permalink" t.integer "position" t.boolean "visible", :default => false t.timestamps end add_index("pages", "subject_id") add-index("pages", "permalink") end def self.down drop_table :pages end end ----------------------------------------------------------- -- 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 For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
tonyaraujo wrote in post #957977:> add_index("pages", "subject_id") > add-index("pages", "permalink")Have you tried this? add_index :pages, :subject_id add_index :pages, :permalink -- Posted via http://www.ruby-forum.com/. -- 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 For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thanks for the reply, after trying your suggestion I still get the same "invalid date " error. I can only migrate if I comment the add_index part. On Oct 29, 5:19 am, Greg Ma <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> tonyaraujo wrote in post #957977: > > > add_index("pages", "subject_id") > > add-index("pages", "permalink") > > Have you tried this? > add_index :pages, :subject_id > add_index :pages, :permalink > > -- > Posted viahttp://www.ruby-forum.com/.-- 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. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Nikos Dimitrakopoulos
2011-Feb-11 08:49 UTC
Re: when migrating add_index error: invalid date
Replace mysql2 gem with mysql (at least for development mode under windows). Solved here : https://groups.google.com/d/msg/rubyonrails-talk/a-wyECimZ5g/1F0sgAcje0cJ -- 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 For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.