migration how to?

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

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!!

Judicious use of add_column and rename_table

Fred