I have been switching between branches in a project and each of them have different migrations... This is the scenario:
$ rake db:migrate:status
<
Migrations are stored in your database. If you want to remove the abandoned migrations, remove them from the db.
Example for Postgres:
Open psql:
psql
Connect to your db:
\c your_database
If you're curious, display schema_migrations:
SELECT * FROM schema_migrations;
If you're curious, check if the abandoned migrations are present:
SELECT version FROM schema_migrations WHERE version IN
('20130320144219', '20130320161939', '20130320184628', '20130403190042',
'20130403195300', '20130403214000', '20130410194222');
Delete them:
DELETE FROM schema_migrations WHERE version IN ();
Now if you run bundle exec rake db:migrate:status, you'll see the orphaned migrations have been successfully removed.