Purge or recreate a Ruby on Rails database

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

    I know two ways to do this:

    This will reset your database and reload your current schema with all:

    rake db:reset db:migrate
    

    This will destroy your db and then create it and then migrate your current schema:

    rake db:drop db:create db:migrate
    

    All data will be lost in both scenarios.

提交回复
热议问题