Purge or recreate a Ruby on Rails database

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

    To drop a particular database, you can do this on rails console:

    $rails console
    Loading development environment
    1.9.3 > ActiveRecord::Migration.drop_table(:)
    1.9.3 > exit
    

    And then migrate DB again

    $bundle exec rake db:migrate 
    

提交回复
热议问题