Home>

Thank you very much. What we want to realize is the title.
The situation is
①rails g migration AddHogeToFuga hoge: string

②rails g migration Remove HogeFromFuga hoge: string

③rails db: migrate

Since it became necessary, if you try to add it again

identical db/migrate/20xxxxxxxxxxxu_add_column_to_fuga.rb


Could not be added.
Is it possible to remove the added column and give it the same name?

  • Answer # 1

      

    Can I add the same name even if I remove the added column?

    You can't just create amigrationwith the same name. If you create a migration with a different name, it will run without problems.

Related articles