This project is archived and is in readonly mode.

#2317 ✓resolved
James B. Byrne

rake db:migrate VERSION=0 applies migration

Reported by James B. Byrne | March 23rd, 2009 @ 07:52 PM | in 2.x

If one does this:

$ rake db:migrate VERSION=0
...

followed by

$ rake db:migrate VERSION=0
Then all the pending migrations are applied, notwithstanding the VERSION=0 setting.

Comments and changes to this ticket

  • Rishav Rastogi

    Rishav Rastogi April 10th, 2010 @ 11:28 PM

    • Tag changed from 2.3.2, db.migrate, rake to db.migrate, rake

    Not reproducable. Can you be more specific please. ?
    Thanks

  • Rishav Rastogi

    Rishav Rastogi April 10th, 2010 @ 11:29 PM

    • Tag changed from db.migrate, rake to 2.3.2, db.migrate, rake
  • Ryan Bigg

    Ryan Bigg April 10th, 2010 @ 11:57 PM

    Could you please provide an example app so that we can test this behaviour? Thanks.

  • kates

    kates April 20th, 2010 @ 11:07 AM

    I am experiencing this also in 2.3.5. Here's how to reproduce.

    $ rails demo
    $ cd rails
    $ script/generate model user login:string password:string
    $ rake db:migrate
    ==  CreateUsers: migrating ====================================================
    -- create_table(:users)
       -> 0.0021s
    ==  CreateUsers: migrated (0.0022s) ===========================================
    
    $ rake db:migrate VERSION=0
    ==  CreateUsers: reverting ====================================================
    -- drop_table(:users)
       -> 0.0007s
    ==  CreateUsers: reverted (0.0007s) ===========================================
    
    $ rake db:migrate VERSION=0
    ==  CreateUsers: migrating ====================================================
    -- create_table(:users)
       -> 0.0015s
    ==  CreateUsers: migrated (0.0016s) ===========================================
    

    including a patch.

  • Ryan Bigg

    Ryan Bigg April 20th, 2010 @ 11:27 AM

    • State changed from “new” to “incomplete”

    If you could, please submit a test for the patch.

  • Neeraj Singh

    Neeraj Singh April 20th, 2010 @ 04:11 PM

    • Tag changed from 2.3.2, db.migrate, rake to 2.3.2, db.migrate, patch, rake

    Attached is a patch with test. Original code fix is also included.

  • Neeraj Singh

    Neeraj Singh April 20th, 2010 @ 04:15 PM

    Last one had a typo for "target".

    Attaching a new patch with test and code fix.

  • Ryan Bigg

    Ryan Bigg April 20th, 2010 @ 09:30 PM

    • State changed from “incomplete” to “open”
  • José Valim

    José Valim April 29th, 2010 @ 01:08 PM

    • State changed from “open” to “resolved”

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

Pages