0

RoR 3.2.13 and 3.0.1 capistrano

My application requires initial data via rake db:seed. My continuous integration server does automatic deployment each time someone join a new feature and all test pass. Among the latest task is rake db:seed.

The first time works fine, but in the following fail the seeds because some records already exist in database.

Which strategy suggest me to run the seeds incrementally.

Note that:

  • The seeds may vary over time.
  • The application already contains data on production.
  • Should be run automatically from the Continuous Integration server.

Who should have the responsibility not to repeat information: Capistrano, the seed itself, the application, continuous integration server?

Montells
  • 6,389
  • 4
  • 48
  • 53

2 Answers2

0

In our team we are using migrations for change db schema and also existing data.

Bob
  • 2,081
  • 18
  • 25
0

The way for seeds is seed-fu. With seed-fu we can make idempotents seeds and means you can run sometimes without alter final result. the way for different seeds by environment or deploys is seedbank

Montells
  • 6,389
  • 4
  • 48
  • 53