← Back to Upcase

Seeding a development database

(Nicolo) #1

I’ve been using a backup of my production database on my development machine for development purposes for a while now.

I want to switch to use seed data to do this for 2 reasons:

  1. Security - There will be more developers working on this application, and they shouldn’t need to have a copy of the production database to do their work

  2. Speed - it just takes a while to restore my dev database from production due to size of the backup file

Is there a recommended approach to this problem? I’m going to seed a lot of data to properly setup my development machines.

Should I be using factories? Should I use any of these gems for db bootstrapping https://www.ruby-toolbox.com/categories/rails_db_bootstrapping?


(Ben Orenstein) #2

You can see how we handle this on the Learn app here: https://github.com/thoughtbot/learn/blob/master/lib/tasks/dev.rake#L2