emfcamp / Website

The Electromagnetic Field web site
http://www.emfcamp.org
GNU Affero General Public License v3.0
41 stars 83 forks source link

Improve DB fixtures #1455

Open marksteward opened 5 months ago

marksteward commented 5 months ago

The DB fixtures need a bit of attention, all independent but worth a look at together:

russss commented 5 months ago

Running dev data should be idempotent or at least warn if it's already run

I think I have very occasionally needed to run this multiple times to add a bit more data. I think if we can find a sensible way to trigger "first run" actions then that should be sufficient.

Product group generation should be moved out to yaml or similar, and should include examples of merch, sponsorship, hires, etc. It'd be nice to be able to export at the end of a year and compare the output with what's in git.

We already export the product group structure as JSON in the post-event export (it's in the private export, although I'm not entirely sure if it needs to be) - so we should just stick a copy of that in the repo (lightly sanitised if necessary) and create from that for dev. It would be nice to also create the ProductViews in a production-like state at the same time.