开发者

Rails migration won't run, no error thrown

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 ?


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜