How do I remove a migration ID listing with "** NO FILE **" in rake db:migrate:status? For example:
Status Migration ID Migration Name
--------------------------------------------------
up 20131017204224 Create users
up 20131218005823 ********** NO FILE **********
up 20131218011334 ********** NO FILE **********
I'm not understanding why it would still keep an old migration file when I manually removed it myself as I was playing around with how migrations work. Is this for record keeping? But what use is it when I don't have a name associated with it?
I tried using db:migrate:down command for those files but it says file missing. I have no clue what to do here.
Can someone explain how to remove this listing and maybe some insight on why this might happen.
You need to delete that numbers from your schema_migrations
table in the database.
You deleted the file but the ID is still in the schema table.
Just Log into mysql
SELECT * FROM schema_migrations; *- take note of the version_id*
Then
DELETE FROM schema_migrations WHERE VERSION = version_id;
Then logout and verify
rake db:migrate:status
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With