This project is archived and is in readonly mode.

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
- 
         Santiago Pastorino November 9th, 2010 @ 09:23 PM- Importance changed from  to Low
 Hey do you want to provide a patch? Please follow http://rails.lighthouseapp.com/projects/8994/sending-patches thanks 
- 
            
         Kevin Skoglund February 4th, 2011 @ 02:38 PMI have attached a patch. David, thanks for flagging this. 
- 
         Repository February 4th, 2011 @ 03:00 PM- State changed from new to committed
 (from [94175c0e39ae9fc8d22dc2c2c55f16c1d92f4090]) Improve regex in rake db:migrate status [#5940 state:resolved] [#5940 state:committed] Signed-off-by: Santiago Pastorino santiago@wyeworks.com 
 https://github.com/rails/rails/commit/94175c0e39ae9fc8d22dc2c2c55f1...
- 
         Repository February 4th, 2011 @ 03:00 PM- State changed from committed to resolved
 (from [94175c0e39ae9fc8d22dc2c2c55f16c1d92f4090]) Improve regex in rake db:migrate status [#5940 state:resolved] [#5940 state:committed] Signed-off-by: Santiago Pastorino santiago@wyeworks.com 
 https://github.com/rails/rails/commit/94175c0e39ae9fc8d22dc2c2c55f1...
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>
People watching this ticket
Attachments
Referenced by
- 
         5940 
          rake db:migrate:status has bad regexp for matching migrations
        (from [94175c0e39ae9fc8d22dc2c2c55f16c1d92f4090])
Improve... 5940 
          rake db:migrate:status has bad regexp for matching migrations
        (from [94175c0e39ae9fc8d22dc2c2c55f16c1d92f4090])
Improve...
- 
         5940 
          rake db:migrate:status has bad regexp for matching migrations
        [#5940 state:committed] 5940 
          rake db:migrate:status has bad regexp for matching migrations
        [#5940 state:committed]
- 
         5940 
          rake db:migrate:status has bad regexp for matching migrations
        (from [94175c0e39ae9fc8d22dc2c2c55f16c1d92f4090])
Improve... 5940 
          rake db:migrate:status has bad regexp for matching migrations
        (from [94175c0e39ae9fc8d22dc2c2c55f16c1d92f4090])
Improve...
- 
         5940 
          rake db:migrate:status has bad regexp for matching migrations
        [#5940 state:committed] 5940 
          rake db:migrate:status has bad regexp for matching migrations
        [#5940 state:committed]
- 
         6404 
          rake db:migrate:status fooled by backup files
        This issue was reported in #5940 and resolved in 
https:/... 6404 
          rake db:migrate:status fooled by backup files
        This issue was reported in #5940 and resolved in 
https:/...
 David Schmidt
      David Schmidt
 Jeremy Kemper
      Jeremy Kemper
 Santiago Pastorino
      Santiago Pastorino