Adding my 2 ยข to this because I ran into the same problem:
If you absolutely want to perform the migration again without creating a new one, you can do the following:
rails dbconsole -p devdb=# delete from public.schema_migrations where version = '20150105181157';
And the rails will โforgetโ that he made the transition to 20150105181157. Now that you run db: migrate, it will start it again.
This is almost always a bad idea. One instance where this might make sense is if you have a development branch and you have not yet defined your migration and want to add some things to it during the development process. But even then, you better make your transition to 2 paths so that you can roll back and try again.
Ken Simon Jan 08 '15 at 18:30 2015-01-08 18:30
source share