This project is archived and is in readonly mode.

#5940 ✓resolved
David Schmidt

rake db:migrate:status has bad regexp for matching migrations

Reported by David Schmidt | November 9th, 2010 @ 07:49 PM

I'm using the Emacs text editor which saves previous versions of files with a '~' suffix. The regexp in activerecord-3.0.1/lib/active_record/railties/database.rake uses following statement to match migration files:

if match_data = /(\d{14})_(.+).rb/.match(file)

However, that will also match the Emacs save files ending in ".rb~". Statement should be:

if match_data = /(\d{14})_(.+).rb$/.match(file)

to ensure that the .rb is at the end of the filename.

This same type of error exists when trying to run migrations since I was unable to run a "rake db:migration:down" where the table did exist and the version was in schema_migrations. It ran fine once I removed the '~' files from the db/migrate directory.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Attachments

Referenced by

Pages