← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~wallyworld/launchpad/person-fk-handling-1071581 into lp:launchpad

 

Ian Booth has proposed merging lp:~wallyworld/launchpad/person-fk-handling-1071581 into lp:launchpad with lp:~wallyworld/launchpad/ppa-packages-timeout-1071581 as a prerequisite.

Commit message:
Add deactivate, merge, and visibility check instructions for the latest package release cache person foreign keys.

Requested reviews:
  Curtis Hovey (sinzui)
Related bugs:
  Bug #1071581 in Launchpad itself: "+ppa-packages timeout"
  https://bugs.launchpad.net/launchpad/+bug/1071581

For more details, see:
https://code.launchpad.net/~wallyworld/launchpad/person-fk-handling-1071581/+merge/133028

== Implementation ==

This branch is another in the set of branches required to fix the bug. It adds deactivate, merge, and visibility check instructions for the latest package release cache person foreign keys (creator and maintainer). The FK's will be added in a subsequent db-devel branch but this code needs to be landed first so stuff doesn't break when the FK's are added.

== Tests ==

No tests will fail with the current codebase. However, I manually added the constraints and verified that the tests pass with the code changes.

== Lint ==

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/lp/registry/model/person.py



-- 
https://code.launchpad.net/~wallyworld/launchpad/person-fk-handling-1071581/+merge/133028
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.
=== modified file 'lib/lp/registry/model/person.py'
--- lib/lp/registry/model/person.py	2012-11-06 09:16:13 +0000
+++ lib/lp/registry/model/person.py	2012-11-06 09:16:13 +0000
@@ -2268,7 +2268,9 @@
             ('BugSubscription', 'person'),
             ('QuestionSubscription', 'person'),
             ('SpecificationSubscription', 'person'),
-            ('AnswerContact', 'person')]
+            ('AnswerContact', 'person'),
+            ('LatestPersonSourcepackageReleaseCache', 'creator'),
+            ('LatestPersonSourcepackageReleaseCache', 'maintainer')]
         cur = cursor()
         for table, person_id_column in removals:
             cur.execute("DELETE FROM %s WHERE %s=%d"
@@ -2345,6 +2347,10 @@
             # Skip mailing lists because if the mailing list is purged, it's
             # not a problem.  Do this check separately below.
             ('mailinglist', 'team'),
+            # The following is denormalised reporting data only loaded if the
+            # user already has access to the team.
+            ('latestpersonsourcepackagereleasecache', 'creator'),
+            ('latestpersonsourcepackagereleasecache', 'maintainer'),
             ])
 
         # The following relationships are allowable for Private teams and
@@ -4353,6 +4359,8 @@
             # These are ON DELETE CASCADE and maintained by triggers.
             ('bugsummary', 'viewed_by'),
             ('bugsummaryjournal', 'viewed_by'),
+            ('latestpersonsourcepackagereleasecache', 'creator'),
+            ('latestpersonsourcepackagereleasecache', 'maintainer'),
             ]
 
         references = list(postgresql.listReferences(cur, 'person', 'id'))


Follow ups