开发者

Rake is out of synch with my Database

开发者 https://www.devze.com 2023-03-09 22:30 出处:网络
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 sche

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

精彩评论

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