Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

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

#5940

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.

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

State: resolved
Milestone: none
Assigned to: nobody
Importance: Low