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 VERSION=0 applies migration

#2317

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.

Reported by James B. Byrne · March 23rd, 2009 @ 07:52 PM

State: resolved
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. Rishav Rastogi
    Rishav Rastogi
    • Tag changed from 2.3.2, db.migrate, rake to db.migrate, rake

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

    April 10th, 2010 @ 11:28 PM

  2. Rishav Rastogi
    Rishav Rastogi
    • Tag changed from db.migrate, rake to 2.3.2, db.migrate, rake

    April 10th, 2010 @ 11:29 PM

  3. Ryan Bigg
    Ryan Bigg

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

    April 10th, 2010 @ 11:57 PM

  4. kates
    kates

    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.

    April 20th, 2010 @ 11:07 AM

  5. Ryan Bigg
    Ryan Bigg
    • State changed from new to incomplete

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

    April 20th, 2010 @ 11:27 AM

  6. Neeraj Singh
    Neeraj Singh
    • 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.

    April 20th, 2010 @ 04:11 PM

  7. Neeraj Singh
    Neeraj Singh

    Last one had a typo for "target".

    Attaching a new patch with test and code fix.

    April 20th, 2010 @ 04:15 PM

  8. Ryan Bigg
    Ryan Bigg
    • State changed from incomplete to open

    April 20th, 2010 @ 09:30 PM

  9. José Valim
    José Valim
    • State changed from open to resolved

    April 29th, 2010 @ 01:08 PM