I have php application with below table structure
CREATE TABLE IF NOT EXISTS `artist_has_fans` (
`artist_id` int(11) NOT NULL,
`fan_id` int(11) NOT NULL,
PRIMARY KEY (`artist_id`,`fan_id`),
KEY `fk_artist_has_artist_artist2` (`fan_id`),
KEY `fk_artist_has_artist_artist1` (`artist_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
I need to write migration in rails so that table has primary key id with autoincrement. Secondly since the table already has some data I need to insert data for id column. Then I need to remove Primary key from existing columns.
Any help on writing migration is appreciated.