How do I remove missing migrations from project?

rails-migrations, ruby-on-rails-4

Solution

You could probably just use a database client and delete the rows from the schema_migrations table (if you promise never to do it again ;).

Problem

So I have made the foolish error of manually removing migration files from my project. They still show up in `db:migrate:status`, but I'm not able to `rollback` or `destroy` them without creating new empty files with MigrationID_somename, and then running destroy on those placeholder files. Is there a better way to forget missing migration files? ``` me$ rake db:migrate:status database: [...]/db/development.sqlite3 Status Migration ID Migration Name -------------------------------------------------- up 20141203044050 ********** NO FILE ********** up 20141203044501 ********** NO FILE ********** me$ rake db:migrate:down VERSION=20141203044501 rake aborted! ActiveRecord::UnknownMigrationVersionError: No migration with version number 20141203044501 /Library/Ruby/Gems/2.0.0/gems/activerecord-4.1.6/lib/active_record/migration.rb:932:in `run' /Library/Ruby/Gems/2.0.0/gems/activerecord-4.1.6/lib/active_record/migration.rb:818:in `run' /Library/Ruby/Gems/2.0.0/gems/activerecord-4.1.6/lib/active_record/railties/databases.rake:79:in `block (3 levels) in <top (required)>' Tasks: TOP => db:migrate:down (See full trace by running task with --trace) ```

Original source