Ask HN: How do you populate a DB to demo your MVC project?
1 comments
What we do is to back up the staging DB, overwrite it with the current production DB, then run the necessary migrations on stage to get the schema up-to-date.
This has a couple of side benefits:
- "Dry" run of the migrations you'll eventually need to run in production anyway
- Using real production data in staging/QA (as long as you're allowed to) can uncover some edge cases you wouldn't have accounted for using fixtures or manual prepopulation.
This has a couple of side benefits:
- "Dry" run of the migrations you'll eventually need to run in production anyway
- Using real production data in staging/QA (as long as you're allowed to) can uncover some edge cases you wouldn't have accounted for using fixtures or manual prepopulation.
Now, do you:
* Load a bunch of fixtures?
* Use Factory Boy / Factory Girl (and if so, where is the code that makes it go?)?
* Grab data from your production DB (and if so, how?)?
* Create model instances manually as you go?
* Some other way?
It seems clear to me that fixtures are no longer the way. If the migration pace is anything but very slow, fixtures become the pain point of staging. Am I correct here?
My typical approach of late has been factory boy / girl, but this increases the amount of code to test and maintain quite substantially. Is there a better way?