Purge or recreate a Ruby on Rails database

前端 未结 19 1279
清酒与你
清酒与你 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:26

    On rails 4.2, to remove all data but preserve the database

    $ bin/rake db:purge && bin/rake db:schema:load
    

    https://github.com/rails/rails/blob/4-2-stable/activerecord/CHANGELOG.md

提交回复
热议问题