Hello,
I am interested in how I add an id field to a table and make it auto
increment.
Basically at the moment I have a link table with groups_members
member_id
group_id
I am changing this to a membership table
id
member_id
group_id
title
position
I could delete groups_members and create memberships however, this
would mean losing all the data that already exists in the table. (NOT
GOOD) instead I would like the id field to auto increment and the
title and position fields to be default "".
Does anyone know how to do this? I had one idea. Save all the current
records in array, delete old table recreate new table reinsert all
data. Is there an easier way!!
Thanks
Iain
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---