railsで特定のマイグレーションファイルをロールバックする
サンプル
Status Migration ID Migration Name -------------------------------------------------- up 20210317022552 Devise create users up 20210317030520 Create sns credentials down 20210318031327 Create posts down 20210318044136 Create active storage tablesactive storage down 20210326063233 Create tags down 20210326063303 Create post tag relations
コマンド
// マイグレーションファイルの状態を確認 % bundle exec rake db:migrate:status // upのファイルをdownにし、再編集できる bundle exec rake db:migrate:down VERSION='upのマイグレーショID'
rails db:rollbackだと1つまえのファイルしか戻せないのでだいぶ前のファイルは上記の方がいいと思います