Hey, i was thinking about "creating-multiple-associations-with-the-same-table" and found this: http://www.spacevatican.org/2008/5/6/creating-multiple-associations-with-the-same-table ive done everything as written but how can i tell ruby to update by database schema? player: id name challenge: P1 P2 after creating i hav a column called players_id then i modified my code as in the tutorial .... then i should hav player1_id, player2_id if im right but i just hav the old database schema... greetz skelle -- 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.
Max Power wrote:> Hey, > i was thinking about > "creating-multiple-associations-with-the-same-table" and found this: > http://www.spacevatican.org/2008/5/6/creating-multiple-associations-with-the-same-table > > ive done everything as written but how can i tell ruby to update by > database schema? > > player: > id > name > > challenge: > P1 > P2 > > after creating i hav a column called players_id > > then i modified my code as in the tutorial .... then i should hav > player1_id, player2_id if im right but i just hav the old database > schema... > > greetz skelleMigrations are your friend grasshopper.... You could try (depends on whether saving the existing data in player_id is useful): 1. creating the two new columns (player1_id and player2_id) and drop the old column player_id 2. or rename the players_id column to player1_id and create a new player2_id column. Just remember to undo the work you do in the "up" in the "down" part of the migration. -- 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... i was close now i got it :) -- 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.