summaryrefslogtreecommitdiff
path: root/patchwork/urls.py
diff options
context:
space:
mode:
authorStephen Finucane <stephen@that.guru>2020-02-29 17:20:50 +0000
committerStephen Finucane <stephen@that.guru>2020-04-26 13:45:45 +0100
commit0686a736fbf6d869bd31bd135ba38080ac96de22 (patch)
tree61ce6dd17c29820680f588fce62e88a07ffcf1b4 /patchwork/urls.py
parent13ff6b2f1a82760dca432296455a3761b34739ed (diff)
downloadpatchwork-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 'patchwork/urls.py')
-rw-r--r--patchwork/urls.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/patchwork/urls.py b/patchwork/urls.py
index 9c3b85f..7d888d4 100644
--- a/patchwork/urls.py
+++ b/patchwork/urls.py
@@ -249,10 +249,10 @@ if settings.ENABLE_REST_API:
api_1_1_patterns = [
url(r'^patches/(?P<pk>[^/]+)/comments/$',
- api_comment_views.CommentList.as_view(),
+ api_comment_views.PatchCommentList.as_view(),
name='api-patch-comment-list'),
url(r'^covers/(?P<pk>[^/]+)/comments/$',
- api_comment_views.CommentList.as_view(),
+ api_comment_views.CoverCommentList.as_view(),
name='api-cover-comment-list'),
]