8 ms·
We've got a core product running on Django, and one thing the author doesn't mention is testing migrations. The migration system is wonderful, except for the di
by zumachase 6y ago
We've got a core product running on Django, and one thing the author doesn't mention is testing migrations. The migration system is wonderful, except for the difficulty in testing migrations. There's no sane/official way to do this. And it's such an important thing that I don't get why the Django crew haven't tackled it.
- ensignavenger 6y agoWhat sort of proposal would you put forth? I generally install one of my production backups onto a staging server (secured appropriately for production data), and run the migrations against it to test.
- jordic 6y agoThat's not the intention on the code, I thought he is talking around writing a migration and a test that ensures the data migration is correctly applied
- _AzMoo 6y agoI've used django-test-migrations before and was really happy with it. https://pypi.org/project/django-test-migrations/ https://pypi.org/project/django-test-migrations/
- zumachase 6y agoWe've played around with that and it's on the roadmap. But it just adds another set of fixtures to herd.
- dvarrazzo 6y agoMy strategy here is to have a staging server where migrations are applied before they can hit production. As someone else pointed out, migration without CI can be dangerous and difficult to coordinate with deployment.
- zumachase 6y agoThis is what we do but it's too manual for my taste.