This project is archived and is in readonly mode.
rake db:migrate:status
Reported by Kevin Skoglund | June 23rd, 2010 @ 05:42 PM | in 3.x
New feature:
A rake task to display the current status of migrations by
comparing db/migrate/* with schema_migrations.
>rake db:migrate:status
database: simple_cms_development
 Status   Migration ID    Migration Name
--------------------------------------------------
   up     20100123211421  Create users
   up     20100123232138  Create subjects
  down    20100123240347  Create pages
   up     20100123215534  *** NO FILE ***
As a bonus, it makes it easy to get a migration ID (double-click & copy) for running up/down/redo tasks.
Comments and changes to this ticket
- 
            
        

Kevin Skoglund June 23rd, 2010 @ 05:47 PM
- Title changed from rake db:migration:status to rake db:migrate:status
 
 - 
            
        

Kevin Skoglund June 23rd, 2010 @ 05:47 PM
- no changes were found...
 
 - 
        

Rohit Arondekar June 24th, 2010 @ 02:24 PM
- Milestone set to 3.x
 - State changed from new to verified
 - Assigned user set to José Valim
 
+1 I would really love this rake task! :)
But the patch has a trailing whitespace problem. Attaching a patch with this fixed. (Preserves complete authorship).
I tried this on a couple of apps and it worked fine.
 - 
            
        

 - 
            
        

 - 
        

José Valim June 24th, 2010 @ 08:16 PM
Would be nice to send this to rails-core list and see people feedback on this. We already have too many tasks and I honestly can't remember a situation in which I needed a task like this although I understand a few people may have had.
 - 
            
        

 - 
            
        

Jeffrey Hardy June 24th, 2010 @ 10:41 PM
Not quite the same thing, but we do have rake db:version.
$ rake db:version Current version: 20100419141336 - 
        

Repository June 28th, 2010 @ 03:09 AM
- State changed from verified to resolved
 - Importance changed from  to Low
 
(from [8e3e117dbe58fd4fedbb78a3d8e398ab0e415634]) rake db:migrate:status displays status of migrations [#4947 state:resolved]
Signed-off-by: Michael Koziarski michael@koziarski.com
http://github.com/rails/rails/commit/8e3e117dbe58fd4fedbb78a3d8e398... - 
        

Michael Koziarski June 28th, 2010 @ 03:10 AM
- State changed from resolved to verified
 
Personally I've wanted this for a while when you merge a long-lived branch it's nice to be able to get a list of everything which has been applied and has yet-to-be-applied. applied to 3,0
 - 
        

Michael Koziarski June 28th, 2010 @ 03:10 AM
- State changed from verified to resolved
 
stupid lighthouse
 - 
            
        

Akira Matsuda June 28th, 2010 @ 04:33 AM
Very cool feature! I love it!
As I found some problems while playing with it, posted patches on #4990.
 - 
            
        

MatthewRudy June 28th, 2010 @ 04:54 AM
This is a good idea,
but perhaps it needs to be honed.I have 172 migrations in my project.
Perhaps it needs some LIMIT=10 option.
 - 
        

José Valim June 28th, 2010 @ 09:06 AM
@Koz, if you like it, I like it! ;)
@Akira, thanks!
@Matthew, could you please provide a patch?
 - 
            
        

Kevin Skoglund June 28th, 2010 @ 01:59 PM
Thanks, Michael and Akira!
Matthew: would "rake db:migrate:status | more" do what you need?
 
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
Tags
Referenced by
- 
        
          4947 
          rake db:migrate:status
        (from [8e3e117dbe58fd4fedbb78a3d8e398ab0e415634])
rake db...
         - 
        
          4990 
          rake db:migrate:status fails when schema migrations table does not exist
        rake db:migrate:status (which were added by #4947) fails
...