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.
Related Posts:
- What is the difference between Rails.cache.clear and rake tmp:cache:clear?
- Rails syntax error : unexpected keyword_ensure, expecting end-of-input
- Rails: Why “sudo” command is not recognized?
- Rails 5 ActionController::InvalidAuthenticityToken error
- what does ? ? mean in ruby
- Parsing XML with Ruby
- Can’t find the ‘libpq-fe.h header when trying to install pg gem
- Rails 4 RoutingError: No Route Matches
- PG::ConnectionBad – could not connect to server: Connection refused
- Removing all installed Gems and starting over
- Ruby: What is the easiest way to remove the first element from an array?
- Ruby String to Date Conversion
- Difference between rake db:migrate db:reset and db:schema:load
- An unhandled lowlevel error occurred. The application logs may have details
- Uploading a file in Rails
- What is the difference between “rake db:seed” and rake db:fixtures:load”
- 400 Bad Request – request header or cookie too large
- Advanced AREL or just Rails Query for has_many through search by association
- What is the meaning of *nix?
- Get underlined text with Markdown
- Why Puma listen on ‘tcp://localhost:3000’ instead of ‘http://localhost:3000’
- Why does Ruby on Rails use http://0.0.0.0:3000 instead of http://localhost:3000?
- How to write a switch statement in Ruby
- bundle install returns “Could not locate Gemfile”
- Rails: Can’t verify CSRF token authenticity when making a POST request
- Getting error: Peer authentication failed for user “postgres”, when trying to get pgsql working with rails
- How to update Ruby Version 2.0.0 to the latest version in Mac OSX Yosemite?
- undefined method `each’ for nil:NilClass… why?
- Bundler: You must use Bundler 2 or greater with this lockfile
- Getting a substring in Ruby by x number of chars
- undefined method `each’ for nil:NilClass… why?
- How to check whether a string contains a substring in Ruby
- Ruby: How to install a specific version of a ruby gem?
- ruby operator “=~” [duplicate]
- Unable to install gem – Failed to build gem native extension – cannot load such file — mkmf (LoadError)
- What is attr_accessor in Ruby?
- ActionController::UnknownFormat
- What does ||= (or-equals) mean in Ruby?
- Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib
- How to read lines of a file in Ruby
- Cannot load such file — bcrypt_ext
- How do I remove Permission denied @ rb_sysopen – Gem install error?
- Ruby: undefined method `[]’ for nil:NilClass when trying to get Enumerator on an Array of Hashes
- Email validation in Ruby on Rails?
- warning: constant ::Fixnum is deprecated When generating new model
- could not connect to server: No such file or directory (PG::ConnectionBad)
- curl : (1) Protocol https not supported or disabled in libcurl
- extconf failed, exit code 1 error when installing [Ruby on Rails] 5 on OS X Yosemite 10.10.5
- couldn’t find file ‘jquery’ with type ‘application/javascript’
- How to sum array of numbers in Ruby?
- Ruby array to string conversion
- How to check if a value exists in an array in Ruby
- Multi-Line Comments in Ruby?
- Getting: “Migrations are pending; run ‘bin/rake db:migrate RAILS_ENV=development’ to resolve this issue.” after cloning and migrating the project
- How to uninstall ruby installed by ruby-install
- How to find out which rails version an existing rails application is built on?
- Ruby `send` vs `call` method
- What is the meaning of “do | |” in Ruby?
- RVM is not a function, selecting rubies with ‘rvm use …’ will not work
- How to delete specific characters from a string in Ruby?
- bcrypt LoadError: Cannot load such file
- Uninitialized constant “Controller Name”
- Rails: I installed Ruby, now “bundle install” doesn’t work
- Devise lockable – How to unlock account using unlock_in
- How to do a newline in output
- How do I format datetime in rails?
- p vs puts in Ruby
- heroku open – no app specified
- Determining type of an object in ruby
- “Error installing rails” because “extconf.rb failed” on Ubuntu 18.04
- Fizz Buzz in Ruby for dummies
- How to Uninstall RVM? [duplicate]
- What is the “right” way to iterate through an array in Ruby?
- TypeError: no implicit conversion of Symbol into Integer
- Equivalent of “continue” in Ruby
- What does the Ruby method ‘to_sym’ do?
- Difference between map and collect in Ruby?
- Rails button_to vs. HTML Button Tag
- GROUP BY and COUNT using ActiveRecord
- How to stop (and restart) the Rails Server?
- Ruby 2.0.0p0 IRB warning: “DL is deprecated, please use Fiddle”
- Getting error: dyld: Symbol not found: _clock_gettime
- Uninstall old versions of Ruby gems
- Migrations are pending; run ‘bin/rake db:migrate RAILS_ENV=development’ to resolve this issue
- What is java interface equivalent in Ruby?
- Sort hash by key, return hash in Ruby
- Gem installation error: You have to install development tools first
- Generate model in Rails using user_id:integer vs user:references
- How to understand strptime vs. strftime
- How can I delete one element from an array by value
- where is devise implementation of “authenticate_user!” method?
- How to break out from a ruby block?
- ERROR: While executing gem … (Gem::FilePermissionError)
- No such file or directory @ rb_sysopen ruby
- How to add to an existing hash in Ruby
- How to convert a string to lower or upper case in Ruby
- What is the canonical way to trim a string in Ruby without creating a new string?
- Difference between $stdout and STDOUT in Ruby
- No implicit conversion of String into Integer (TypeError)?
- How to force or redirect to SSL in nginx?