开发者

Rake is out of synch with my Database

I have inherited a Ruby on Rails project where the programmer didn't us开发者_开发百科e rake to create the db schema, so it seems very out of synch, is there a way to rectify this?


First create a schema.rb file

rake db:schema:dump

Then make a migration ot of it.

class CreateMigration < ActiveRecord::Migration
  def self.up
    # insert schema.rb here
  end

  def self.down
  end
end

You might also need to create the schema_migrations table, and manually add the timestamp for this migration to it.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜