django-waffle icon indicating copy to clipboard operation
django-waffle copied to clipboard

Provide reusable migration classes to add/remove/rename switches?

Open eviljeff opened this issue 7 months ago • 3 comments

We wrote some django migration classes to allow us to programmatically add, delete, or rename waffle switches in our migrations a while back - https://github.com/mozilla/addons-server/blob/master/src/olympia/core/db/migrations.py - is this worth contributing upstream into this project?

eviljeff avatar Apr 28 '25 10:04 eviljeff

Relates to #502 - This looks like a nice clean implementation. What do you think @clintonb ? I think this would help people onboard with the library.

dancergraham avatar Apr 29 '25 10:04 dancergraham

example use: https://github.com/mozilla/addons-server/blob/master/src/olympia/devhub/migrations/0003_auto_20220413_1016.py

There's more it could do (e.g. optionally allow other fields like name to be defined) - and the Flag implementation is needed too - but let me know if it's worth me knocking up a PR.

eviljeff avatar Apr 29 '25 11:04 eviljeff

I see no objections - on reflection I'm going to say "yes" this would be a good addition to the library - if you can contribute a PR, including a small note in the docs to point people to it, that would be awesome !

dancergraham avatar May 07 '25 07:05 dancergraham