StaticDiff is unused and needs to be shot
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
Low
|
Steve Kowalik |
Bug Description
StaticDiff is unused, and the last row was added to the table in January 2010. The table is only 30k rows, and roughly 20k of those are not linked to BranchMergeProp
We can migrate the linked rows from StaticDiff to PreviewDiffs by the following SQL:
CREATE INDEX temp_previewdiff ON previewdiff(
INSERT INTO previewdiff (source_
UPDATE branchmergeproposal SET merge_diff = (SELECT id FROM previewdiff WHERE from_revision_id = source_revision_id AND to_revision_id = target_revision_id) FROM staticdiff WHERE staticdiff.id = review_diff AND merge_diff IS NULL; (expecting 5,251 rows)
UPDATE branchmergeproposal SET review_diff = null WHERE review_diff IS NOT NULL AND merge_diff IS NOT NULL; (expecting 12,111 rows)
ALTER TABLE branchmergeproposal DROP CONSTRAINT branchmergeprop
Related branches
- Gavin Panella (community): Approve
-
Diff: 1285 lines (+53/-615)21 files modifieddatabase/sampledata/current-dev.sql (+0/-7)
database/sampledata/current.sql (+0/-8)
database/schema/security.cfg (+0/-6)
lib/lp/code/browser/branchmergeproposal.py (+4/-8)
lib/lp/code/browser/tests/test_branchmergeproposal.py (+2/-37)
lib/lp/code/configure.zcml (+0/-18)
lib/lp/code/interfaces/branchjob.py (+1/-30)
lib/lp/code/interfaces/branchmergeproposal.py (+2/-9)
lib/lp/code/interfaces/diff.py (+1/-37)
lib/lp/code/interfaces/webservice.py (+1/-3)
lib/lp/code/model/branch.py (+1/-1)
lib/lp/code/model/branchjob.py (+7/-80)
lib/lp/code/model/branchmergeproposal.py (+1/-4)
lib/lp/code/model/diff.py (+7/-56)
lib/lp/code/model/tests/test_branch.py (+4/-4)
lib/lp/code/model/tests/test_branchjob.py (+11/-158)
lib/lp/code/model/tests/test_diff.py (+4/-86)
lib/lp/code/scripts/tests/test_sendbranchmail.py (+4/-6)
lib/lp/codehosting/scanner/email.py (+3/-3)
lib/lp/codehosting/tests/test_jobs.py (+0/-48)
lib/lp/testing/factory.py (+0/-6)
description: | updated |
Changed in launchpad: | |
status: | Fix Committed → Fix Released |
If we create a temporary index, we need to drop it.
Due to the ALTER TABLE, this is a downtime db patch.