p.132 of Agile Web book has these two lines... but it seems that they cause an error when "rake db:migrate" execute "alter table line_items add constraint fk_line_item_products foreign key (product_id) references products(id)" execute "alter table line_items add constraint fk_line_item_orders foreign key (order_id) references orders(id)" gives: (i tried a different table called "foo") C:\rails\depot>rake db:migrate (in C:/rails/depot) -- execute("alter table foos add constraint fk_foo_products \n foreign key ( product_id) references products(id)") rake aborted! Mysql::Error: Table ''depot_development.foos'' doesn''t exist: alter table foos add constraint fk_foo_products foreign key (product_id) references products(id) (See full trace by running task with --trace) -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Summercool Summercool wrote:> > p.132 of Agile Web book has these two lines... > but it seems that they cause an error when "rake db:migrate" > > > > execute "alter table line_items add constraint fk_line_item_products > foreign key (product_id) references products(id)" > > > execute "alter table line_items add constraint fk_line_item_orders > foreign key (order_id) references orders(id)"i found the error... visually, the code looks like in between self.up and down... and then actually, the code is in the up definition... outside of up it will give error. -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---