views:

76

answers:

2

Here's a simple migration I'd like to run :

class AddTimeOfRevisionToBrandWikis < ActiveRecord::Migration
  def self.up
    add_column :brand_wikis, :time_of_revision, :datetime
  end

  def self.down
    remove_column :brand_wikis, :time_of_revision
  end
end

Here's what I get when I try to run it :

$ rake db:migrate
(in /Users/kouak/Documents/workspace/wtb)
You have 1 pending migrations:
  20100404115341 AddTimeOfRevisionToBrandWikis
Run "rake db:migrate" to update your database then try again.

What's wrong with rake db:migrate ?

A: 

check your schema version and also last migration number the one you running now must be last.

Salil
A: 

There is nothing wrong with that migration class.

That error is generated by the rake task db:abort_if_pending_migrations which is called by db:test:prepare which is called by all the test tasks. Somehow you've created a dependency for db:migrate that runs the db:abort_if_pending_migrations. Look in your Rakefile.

dasil003
Had this in a custom rcov.rake file. Thanks a lot.
kouak