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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:34:00+00:00 2026-05-12T08:34:00+00:00

Best way to load seed data? I have an Author table that is tightly

  • 0

Best way to load seed data? I have an Author table that is tightly coupled with a Users table. I also have migrations to alter both of these tables. I want to add a default admin user but I want to make sure that both tables are created and all migrations have run for these tables before my CreateDefaultAdmin (or whatever) migration runs. Is there a best practices for doing this? Sorry if this was already asked.

  • 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-12T08:34:00+00:00Added an answer on May 12, 2026 at 8:34 am

    Your options:

    1. Use migrations as outlined here: http://railspikes.com/2008/2/1/loading-seed-data
    2. Use a 3rd party addon like: seed-fu or db-populate
    3. Use fixtures, which is outlined in the rails spike article.
    4. Wait for rails 3 and use the new seeds.rb: http://github.com/rails/rails/commit/4932f7b38f72104819022abca0c952ba6f9888cb

    Personally I use a modified yaml-db. I like to build up all my seed data into my dev environment, and keep it backed up in my repository, when I go live I can load it with a rake task.

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

Sidebar

Related Questions

How is the best way to load Category model, for ProductController in new, edit
What is the best way to load a WebView in the background, while leaving
What is the best way to load a WebView in the background, while leaving
I'm trying to decide on the best way to load in some configuration settings.
With Javascript, I'm wondering what's the current best way to load my code onto
I have some configuration values in a YAML file that needs loaded when my
I have a large, dynamically generated, single page website that heavily relies on javascript.
I need to write an Android app that would download sounds from the internet
I'm working on a basic tiling engine for XNA 4.0 on Windows Phone 7.
Just starting to use CodeIgniter, and I'd like to import some of my old

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.