How to quickly re-seed your Rails database
August 20, 2020 (Updated April 13, 2021)
rails db:seed:replant
Sometimes, it's useful to wipe the database of all existing records and rerun all our seeds in db/seeds.rb
.
The rails db:seed:replant
does exactly this. It doesn't actually drop our database and rerun our migrations. It only clears/truncates the database.
Tagged:
Rails