Search code examples
ruby-on-railsrubydatabaseruby-on-rails-3rake

How to completely delete a DB on Ruby on Rails?


I have a small Ruby on Rails app, and I made a mistake creating a model and so on.

How can I fully delete its database? Not reseting migrations or dropping its tables, but to delete all db related files? (schema.rb, etc)


Solution

  • To drop database

    rake db:drop
    

    Then for creating database

    rake db:create
    

    For migrations

    rake db:migrate
    

    For seed

    rake db:seed