Remove RecipeRevision.[countries|locales|channels] manytomany fields
These have been migrated to filter_object_json where appropriate.
Whoaaa! This led me deep into a rabbit hole of hacking that just started tasting worse per edit.
The countries, locales, and channels is deeply integrated in the code. There are lots of complex tests that depend on it being a ManyToManyField. For example, the test_models.py depends on doing things like this: https://github.com/mozilla/normandy/blob/d17dbe00ca32df582a732ac0cf121dc7f72313bb/normandy/recipes/tests/test_models.py#L470-L486
There's also the deeply complex migrations and their unit test code that tests migrating from these ManyToManyFields to filter_objects.
Until all of these things have been refactored, carefully, then can we worry about removing the many-to-many tables.
Would it make sense to remove the fields from the API, so we don't get any new recipes with these fields set?
Rough guestimate of work...
- [x] Remove unit tests that mess with revising the
countries,localesandchannels. - [ ] Don't make it possible to filter the API (all 3 versions, sigh) by locales, countries or channels. (@mythmon is that ok?)
- [x] Remove unit tests that test filtering (and serializing?) around these three fields.
- [ ] MOre aggressive stuff.
If this is sane, let's do it gently with one thing at a time.
Would it make sense to remove the fields from the API, so we don't get any new recipes with these fields set?
Uh? So there are still some that come in an populate the database for the many-to-many tables? I.e. stuff that goes against that big data migration when filter_object_json was launched.
Uh? So there are still some that come in an populate the database for the many-to-many tables? I.e. stuff that goes against that big data migration when filter_object_json was launched.
In practice, no. There shouldn't be any new data, since none of the tools that write to the API expose these fields. Sorry if I gave you false alarm. In theory it is possible though, since those fields exist.
I think I need to remind myself that we shall not undo the Channels, Locales and Countries models. Maybe we do at some point but it's out of context for this issue.
slow many-to-many db fields that never ended up getting used that are slow. so should just delete them
I took a stab at this in #1943, and I've decided it is not actually a good-first-bug.