I got a file like this You can't bring down the migration file because you can't rollback
up 20200926110535 ********** NO FILE **********
Probably with the migration status UP I have deleted the migration file.
In my case, I deleted the entire change on the git desktop, so it seems that this incident happened.
Well, as a result of seeing some of the articles posted by everyone, it was solved safely.
First, to give a name to no faile Run this command in the terminal: zap: (Change the migration ID to your nofile ID. The name after that is a dummy, so anything is fine. )
% touch db/migrate/20200926110535_fuwafuwa.rb
After execution ↓
20200926110535_fuwafuwa.rb
class Hoge < ActiveRecord::Migration[5.2]
def change
end
end
Then the above name migration file will It should exist.
After that, if you check rails db: migrate: status and it looks like this, it is successful.
up 20200926110535 fuwafuwa
After that, if you delete the migration file earlier, it will be solved safely! : corn:
Recommended Posts