Purge or recreate a Ruby on Rails database

前端 未结 19 1286
清酒与你
清酒与你 2020-11-28 17:01

I have a dev Ruby on Rails database full of data. I want to delete everything and rebuild the database. I\'m thinking of using something like:

rake db:recrea         


        
19条回答
  •  生来不讨喜
    2020-11-28 17:24

    On Rails 4, all needed is

    $ rake db:schema:load
    

    That would delete the entire contents on your DB and recreate the schema from your schema.rb file, without having to apply all migrations one by one.

提交回复
热议问题