Rake db:migrate -VERSION=0 not working

Good morning,

I’ve got a very basic migration that creates a Stories table (going
through the SitePoint rails book). It’s version 1 and looks like this:

class CreateStories < ActiveRecord::Migration
def self.up
create_table :stories, :force => true do |t|
t.column :name, :string
t.column :link, :string
end
end

def self.down
drop_table :stories
end
end

On a completely empty database, if I run rake db:migrate it creates the
stories table along with schema_info and in schema_info it shows version

  1. However, I want to test the rollback feature. So I run rake
    db:migrate -VERSION=0. Nothing is showing up in the development log, and
    rake it just returning rake, version 0.7.2. The stories table still
    exists in the database when I would expect it to be gone.

Anyone have an idea?

Thanks,
JP

Remove the ‘-’ from the rake command. You should have:

rake db:migrate VERSION=0

-v is a switch to show the version of rake you have installed.

Steve

Remove the ‘-’ from the rake command. You should have:

rake db:migrate VERSION=0

-v is a switch to show the version of rake you have installed.

Steve

Thanks very much. That’s a typo in the book. I should have caught that
by running rake --tasks.

Stephen B. wrote:

Remove the ‘-’ from the rake command. You should have:

rake db:migrate VERSION=0

-v is a switch to show the version of rake you have installed.

Steve

JP wrote:

So I run rake db:migrate -VERSION=0.
Anyone have an idea?

Good day. It is rake db:migrate --VERSION=0

Damian/Three-eyed Fish

Leave out - in front of VERSION. Just run: rake db:migrate VERSION=0.

I hope that helps!

Nicolai

No dashes.

rake db:migrate VERSION=0