diff options
author | Stephen Finucane <stephen@that.guru> | 2020-02-29 17:20:50 +0000 |
---|---|---|
committer | Stephen Finucane <stephen@that.guru> | 2020-04-26 13:45:45 +0100 |
commit | 0686a736fbf6d869bd31bd135ba38080ac96de22 (patch) | |
tree | 61ce6dd17c29820680f588fce62e88a07ffcf1b4 /lib | |
parent | 13ff6b2f1a82760dca432296455a3761b34739ed (diff) | |
download | patchwork-0686a736fbf6d869bd31bd135ba38080ac96de22.tar patchwork-0686a736fbf6d869bd31bd135ba38080ac96de22.tar.gz |
models: Split 'CoverLetter' from 'Submission'
We want to get rid of the split between 'Patch' and 'Submission' because
of the cost of using JOINs basically everywhere we use 'Patch'. Before
we do that, we need to move the other users of 'Submission' to other
models and other models that rely on these users sharing the common
'Submission' base. For the former, there is only one user,
'CoverLetter', while for the latter there is only the 'Comment' model.
As a result, we must do the following:
- Create a new 'Cover' model
- Create a new 'CoverComment' model
- Move everything from 'CoverLetter' to 'Cover' and all entries
associated with a 'CoverLetter' from 'Comment' to 'CoverComment'
- Delete the 'CoverLetter' model
- Rename the 'Comment' model to 'PatchComment'
This means our model "hierarchy" goes from:
Submission
Patch
CoverLetter
Comment
To:
Submission
Patch
PatchComment
Cover
CoverComment
A future change will flatten the 'Submission' and 'Patch' model.
Note that this actually highlighted a bug in Django, which has since
been reported upstream [1]. As noted there, the issue stems from MySQL's
refusal to remove an index from a foreign key when DB constraints are
used and the workaround is to remove the foreign key constraint before
altering the indexes and then re-add the constraint after.
[1] https://code.djangoproject.com/ticket/31335
Signed-off-by: Stephen Finucane <stephen@that.guru>
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions