[PATCH 1/5] Add log_msg field
jk at ozlabs.org
Mon Mar 23 10:09:03 EST 2009
> Create a new patch field named 'log_msg' which contains the patch
> commit log message. Previously this was stored as the first comment
> of the patch. Storing it explicitly gets rid of the special case
> handling for comment 0 and eliminates the redundant metadata between
> comment 0 and the patch object. It also has the nice side effect of
> making the number of comments accurately reflect how many replies
> were made to the patch.
Since this change involves a *lot* of changes to existing patchwork
installations, I'm reluctant to accept it without a really good reason
for the change. Between ozlabs.org and kernel.org, we have around 50,000
patch objects that would need to be updated due to this schema change.
As you say, on one hand we don't need the special case for generating
the mbox data, but now we do need special case for the log_msg field in
the patch template (in which case we need to fake it up as a comment).
However, if there *is* a compelling reason to do so, I'm happy to merge
this, you just need to convince me first :)
If you're looking for correct counts, just do a:
Comment.objects.filter(patch = patch). \
filter(msg_id != patch.msg_id).count()
Also, please include a SQL-only migration script, rather than a python
one. Makes it much easier to upgrade.
More information about the Patchwork