← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~lifeless/launchpad/bugmessage into lp:launchpad

 

Robert Collins has proposed merging lp:~lifeless/launchpad/bugmessage into lp:launchpad.

Requested reviews:
  Stuart Bishop (stub)
  Launchpad code reviewers (launchpad-reviewers)


Permit future improvements to all bug pages that show messages or attachments by removing a current rather crazy runtime analysis for message sequence.
-- 
https://code.launchpad.net/~lifeless/launchpad/bugmessage/+merge/35620
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~lifeless/launchpad/bugmessage into lp:launchpad.
=== modified file 'database/schema/comments.sql'
--- database/schema/comments.sql	2010-09-13 09:14:47 +0000
+++ database/schema/comments.sql	2010-09-16 01:33:50 +0000
@@ -1292,11 +1292,14 @@
 
 COMMENT ON TABLE ProjectBounty IS 'This table records a simple link between a bounty and a project. This bounty will be listed on the project web page, and the project will be mentioned on the bounty web page.';
 
--- Messaging subsytem
+-- BugMessages
 COMMENT ON TABLE BugMessage IS 'This table maps a message to a bug. In other words, it shows that a particular message is associated with a particular bug.';
 COMMENT ON COLUMN BugMessage.bugwatch IS 'The external bug this bug comment was imported from.';
 COMMENT ON COLUMN BugMessage.remote_comment_id IS 'The id this bug comment has in the external bug tracker, if it is an imported comment. If it is NULL while having a bugwatch set, this comment was added in Launchpad and needs to be pushed to the external bug tracker.';
 COMMENT ON COLUMN BugMessage.visible IS 'If false, the bug comment is hidden and should not be shown in any UI.';
+COMMENT ON COLUMN BugMessage.index IS 'The index (used in urls) of the message in a particular bug.';
+
+-- Messaging subsytem
 COMMENT ON TABLE Message IS 'This table stores a single RFC822-style message. Messages can be threaded (using the parent field). These messages can then be referenced from elsewhere in the system, such as the BugMessage table, integrating messageboard facilities with the rest of The Launchpad.';
 COMMENT ON COLUMN Message.parent IS 'A "parent message". This allows for some level of threading in Messages.';
 COMMENT ON COLUMN Message.subject IS 'The title text of the message, or the subject if it was an email.';

=== added file 'database/schema/patch-2208-99-0.sql'
--- database/schema/patch-2208-99-0.sql	1970-01-01 00:00:00 +0000
+++ database/schema/patch-2208-99-0.sql	2010-09-16 01:33:50 +0000
@@ -0,0 +1,11 @@
+SET client_min_messages=ERROR;
+
+-- Store the row index of bug messages so we don't have to calculate it all the time.
+ALTER TABLE BugMessage ADD COLUMN index integer;
+
+-- BugMessage.indexes must be unique per bug (index can be added post-rollout
+-- if its slow).
+CREATE UNIQUE INDEX bugmessage__bug_index_unique ON BugMessage (bug, index);
+
+
+INSERT INTO LaunchpadDatabaseRevision VALUES (2208, 99, 0);

=== modified file 'lib/lp/bugs/model/bugmessage.py'
--- lib/lp/bugs/model/bugmessage.py	2010-08-20 20:31:18 +0000
+++ lib/lp/bugs/model/bugmessage.py	2010-09-16 01:33:50 +0000
@@ -44,6 +44,8 @@
         notNull=False, default=None)
     remote_comment_id = StringCol(notNull=False, default=None)
     visible = BoolCol(notNull=True, default=True)
+    # -- Uncomment when deployed.
+    # index = IntCol()
 
 
 class BugMessageSet:


Follow ups