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 8558819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:53:56+00:00 2026-06-11T15:53:56+00:00

I populated my development db with dummy data for 20 users using the Faker

  • 0

I populated my development db with dummy data for 20 users using the Faker gem.

I forgot to include a “created_at” time, so they are now all ordered ahead of my hand-created detailed user records. I would like to either:

1) delete the 20 dummy users, and repopulate them with older “created_at” times, or

2) update the 20 dummy users’ “created_at” attributes with older times.

Option 1 is easy enough if there is a way to undo my initial population rake. Is there a way to do this?

Thanks!

  • 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-06-11T15:53:57+00:00Added an answer on June 11, 2026 at 3:53 pm

    In rails there is no option to remove data in database other than rake tasks.

    In this case i think option 1 is better one as there is not much effort to be put. Since created_at is updated automatically while creation of recored you need not do that. You just need to delete data from users table.

    Just type rails db in project folder in terminal and there type following command

    delete from users where id in ( select id from users order desc LIMIT 20)
    

    It will delete last 20 users.

    Create a new migration to add created_at column to table.

    Run the rake task.

    Everything will go perfect!

    Thanks

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

Sidebar

Related Questions

I have a database table on a development server that is now fully populated
Using a populated Table Type as the source for a TSQL-Merge. I want to
I have an JPanel populated with several opaque custom components. Now I would like
I've populated a ListActivity from a Cursor using SimpleCursorAdapter that starts another activity when
I have a table populated with time stamped rows inserted at (essentially) random point
I have a table 'invoices' in my development database (sqlite3) populated with a small
I'm just picking up development in CakePHP right now so forgive me if this
When a user is editing data in a form that is populated from a
In my app, I have a UITableView that is populated by Core Data, currently
Is there a way to toggle show/hide for data that is dynamically populated in

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.