Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6558427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:11:56+00:00 2026-05-25T13:11:56+00:00

rake db:seed Does rerunning seed data drop the existing seed data and re-create or

  • 0
rake db:seed

Does rerunning seed data drop the existing seed data and re-create or adds just the new records whenever you modify the seed data?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T13:11:56+00:00Added an answer on May 25, 2026 at 1:11 pm

    When you run rake db:seed, db/seeds.rb is only included with the rails environment.
    Therefore, nothing else is done on your database than what you mention it to do.

    I usually put the following at the top of my db/seeds file :

    Dir['app/models/**/*.rb'].each do |model|
        model_object = model.camelize.constantize
        model_object.delete_all
    end
    

    This way, all previous seed data is removed, and I get this fresh new proper data I want in my dev environment.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does rake db:migrate only add new migrations, or does it drop all migrations/changes and
I have a rake task to seed an application with random data using the
I created reset_db.bat on Windows with the following content: rake db:drop RAILS_ENV=development rake db:create
Currently i'm using this: edit creation migrate rake db:drop rake db:migrate rake db:seed but
rake routes: new_user_session GET /users/sign_in(.:format) {:action=>new, :controller=>devise/sessions} user_session POST /users/sign_in(.:format) {:action=>create, :controller=>devise/sessions} destroy_user_session DELETE
I have the following task: namespace :db do desc Drop, create, migrate, seed the
Is there a rake task for backing up the data in your database? I
I'm writing a rake task that does some DB work outside of Rails/ActiveRecord. Is
I'm using rake to create a Table of contents from a bunch of static
Rake db:seed populates your db with default database values for an app right? So

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.