0

I recently updated a Rails 4.2 app to 5.1.4. After upgrading, whenever I try to run rake db:migrate, I get a DuplicateMigrationNameError. The first few times, the error pointed to a file so I just changed the name of the migration class and the file name. But after 4 such changes, the rake task threw the error for the file I just changed, with the new file name/class name. If I changed it back, it still threw the same error. If I changed it to something totally new the same thing happened; it picked up the new filename and threw a DuplicateMigrationNameError. I do not have a duplicate file, there are no cached files that I can find. I am running the rails app in a vagrant vm running ubuntu 16.04. The migrations all ran fine on rails 4.2.

Stephen
  • 174
  • 4
  • 14
  • I'm having the exact same issue. I don't have any duplicated migration class names in my project folder. – Anders H Nov 30 '17 at 07:35
  • @stephen - Did you find the solution? I'm facing the same issue when I update rails from 3 to 5. Same migrations are working fine in rails 3. – Mr Sindhu Dec 13 '21 at 10:28

1 Answers1

0

This can also happen when the class name of the migration is duplicated. Open the migrations and see if the class names are identical.

Aaron Breckenridge
  • 1,723
  • 18
  • 25