I need to migrate an old mysql table like this:
Products
name (string, primary_key)
to this schema:
Products
id (integer, primary_key, auto_generated)
name (unique)
I need the Products.id values populated in the new table. How can i write the rails migration file? I am using Rails 3.2.7
I have 2 problems now: 1. I can't find a method to remove primary key in ActiveRecord::Migration 2. I don't know how to generate values for newly added primary key.