Merge lp:~cjwatson/launchpad/dsp-sampledata into lp:launchpad

Proposed by Colin Watson
Status: Merged
Merged at revision: 18155
Proposed branch: lp:~cjwatson/launchpad/dsp-sampledata
Merge into: lp:launchpad
Diff against target: 52 lines (+31/-0)
2 files modified
database/sampledata/current-dev.sql (+17/-0)
database/sampledata/current.sql (+14/-0)
To merge this branch: bzr merge lp:~cjwatson/launchpad/dsp-sampledata
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+300870@code.launchpad.net

Commit message

Add DistributionSourcePackage rows to sampledata matching current SourcePackagePublishingHistory rows.

Description of the change

PublishingSet.newSourcePublication has called DistributionSourcePackage.ensure for about six years now. Create corresponding DistributionSourcePackage rows in sampledata as if this had been done. This makes it easier to experiment with the DistributionSourcePackage vocabulary.

This was generated using the following query:

INSERT INTO distributionsourcepackage
    (distribution, sourcepackagename, is_upstream_link_allowed)
SELECT DISTINCT
    distroseries.distribution,
    sourcepackagerelease.sourcepackagename,
    section.name = 'misc'
FROM
    sourcepackagepublishinghistory,
    distroseries,
    sourcepackagerelease,
    section
WHERE
    sourcepackagepublishinghistory.distroseries = distroseries.id
    AND sourcepackagepublishinghistory.sourcepackagerelease =
        sourcepackagerelease.id
    AND sourcepackagepublishinghistory.section = section.id;

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'database/sampledata/current-dev.sql'
2--- database/sampledata/current-dev.sql 2016-06-28 21:04:41 +0000
3+++ database/sampledata/current-dev.sql 2016-07-22 11:24:10 +0000
4@@ -3465,6 +3465,23 @@
5
6 ALTER TABLE distributionsourcepackage DISABLE TRIGGER ALL;
7
8+INSERT INTO distributionsourcepackage (id, distribution, sourcepackagename, bug_reporting_guidelines, max_bug_heat, bug_reported_acknowledgement, total_bug_heat, bug_count, po_message_count, is_upstream_link_allowed, enable_bugfiling_duplicate_search) VALUES (1, 1, 20, NULL, NULL, NULL, NULL, NULL, NULL, false, true);
9+INSERT INTO distributionsourcepackage (id, distribution, sourcepackagename, bug_reporting_guidelines, max_bug_heat, bug_reported_acknowledgement, total_bug_heat, bug_count, po_message_count, is_upstream_link_allowed, enable_bugfiling_duplicate_search) VALUES (2, 1, 23, NULL, NULL, NULL, NULL, NULL, NULL, false, true);
10+INSERT INTO distributionsourcepackage (id, distribution, sourcepackagename, bug_reporting_guidelines, max_bug_heat, bug_reported_acknowledgement, total_bug_heat, bug_count, po_message_count, is_upstream_link_allowed, enable_bugfiling_duplicate_search) VALUES (3, 1, 9, NULL, NULL, NULL, NULL, NULL, NULL, false, true);
11+INSERT INTO distributionsourcepackage (id, distribution, sourcepackagename, bug_reporting_guidelines, max_bug_heat, bug_reported_acknowledgement, total_bug_heat, bug_count, po_message_count, is_upstream_link_allowed, enable_bugfiling_duplicate_search) VALUES (4, 1, 24, NULL, NULL, NULL, NULL, NULL, NULL, false, true);
12+INSERT INTO distributionsourcepackage (id, distribution, sourcepackagename, bug_reporting_guidelines, max_bug_heat, bug_reported_acknowledgement, total_bug_heat, bug_count, po_message_count, is_upstream_link_allowed, enable_bugfiling_duplicate_search) VALUES (5, 1, 22, NULL, NULL, NULL, NULL, NULL, NULL, false, true);
13+INSERT INTO distributionsourcepackage (id, distribution, sourcepackagename, bug_reporting_guidelines, max_bug_heat, bug_reported_acknowledgement, total_bug_heat, bug_count, po_message_count, is_upstream_link_allowed, enable_bugfiling_duplicate_search) VALUES (6, 8, 19, NULL, NULL, NULL, NULL, NULL, NULL, false, true);
14+INSERT INTO distributionsourcepackage (id, distribution, sourcepackagename, bug_reporting_guidelines, max_bug_heat, bug_reported_acknowledgement, total_bug_heat, bug_count, po_message_count, is_upstream_link_allowed, enable_bugfiling_duplicate_search) VALUES (7, 3, 19, NULL, NULL, NULL, NULL, NULL, NULL, false, true);
15+INSERT INTO distributionsourcepackage (id, distribution, sourcepackagename, bug_reporting_guidelines, max_bug_heat, bug_reported_acknowledgement, total_bug_heat, bug_count, po_message_count, is_upstream_link_allowed, enable_bugfiling_duplicate_search) VALUES (8, 1, 21, NULL, NULL, NULL, NULL, NULL, NULL, false, true);
16+INSERT INTO distributionsourcepackage (id, distribution, sourcepackagename, bug_reporting_guidelines, max_bug_heat, bug_reported_acknowledgement, total_bug_heat, bug_count, po_message_count, is_upstream_link_allowed, enable_bugfiling_duplicate_search) VALUES (9, 9, 1, NULL, NULL, NULL, NULL, NULL, NULL, false, true);
17+INSERT INTO distributionsourcepackage (id, distribution, sourcepackagename, bug_reporting_guidelines, max_bug_heat, bug_reported_acknowledgement, total_bug_heat, bug_count, po_message_count, is_upstream_link_allowed, enable_bugfiling_duplicate_search) VALUES (10, 1, 19, NULL, NULL, NULL, NULL, NULL, NULL, false, true);
18+INSERT INTO distributionsourcepackage (id, distribution, sourcepackagename, bug_reporting_guidelines, max_bug_heat, bug_reported_acknowledgement, total_bug_heat, bug_count, po_message_count, is_upstream_link_allowed, enable_bugfiling_duplicate_search) VALUES (11, 1, 26, NULL, NULL, NULL, NULL, NULL, NULL, false, true);
19+INSERT INTO distributionsourcepackage (id, distribution, sourcepackagename, bug_reporting_guidelines, max_bug_heat, bug_reported_acknowledgement, total_bug_heat, bug_count, po_message_count, is_upstream_link_allowed, enable_bugfiling_duplicate_search) VALUES (12, 9, 9, NULL, NULL, NULL, NULL, NULL, NULL, false, true);
20+INSERT INTO distributionsourcepackage (id, distribution, sourcepackagename, bug_reporting_guidelines, max_bug_heat, bug_reported_acknowledgement, total_bug_heat, bug_count, po_message_count, is_upstream_link_allowed, enable_bugfiling_duplicate_search) VALUES (13, 1, 27, NULL, NULL, NULL, NULL, NULL, NULL, false, true);
21+INSERT INTO distributionsourcepackage (id, distribution, sourcepackagename, bug_reporting_guidelines, max_bug_heat, bug_reported_acknowledgement, total_bug_heat, bug_count, po_message_count, is_upstream_link_allowed, enable_bugfiling_duplicate_search) VALUES (14, 1, 14, NULL, NULL, NULL, NULL, NULL, NULL, false, true);
22+INSERT INTO distributionsourcepackage (id, distribution, sourcepackagename, bug_reporting_guidelines, max_bug_heat, bug_reported_acknowledgement, total_bug_heat, bug_count, po_message_count, is_upstream_link_allowed, enable_bugfiling_duplicate_search) VALUES (15, 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, false, true);
23+INSERT INTO distributionsourcepackage (id, distribution, sourcepackagename, bug_reporting_guidelines, max_bug_heat, bug_reported_acknowledgement, total_bug_heat, bug_count, po_message_count, is_upstream_link_allowed, enable_bugfiling_duplicate_search) VALUES (16, 1, 10, NULL, NULL, NULL, NULL, NULL, NULL, false, true);
24+INSERT INTO distributionsourcepackage (id, distribution, sourcepackagename, bug_reporting_guidelines, max_bug_heat, bug_reported_acknowledgement, total_bug_heat, bug_count, po_message_count, is_upstream_link_allowed, enable_bugfiling_duplicate_search) VALUES (17, 9, 19, NULL, NULL, NULL, NULL, NULL, NULL, false, true);
25
26
27 ALTER TABLE distributionsourcepackage ENABLE TRIGGER ALL;
28
29=== modified file 'database/sampledata/current.sql'
30--- database/sampledata/current.sql 2016-06-28 21:04:41 +0000
31+++ database/sampledata/current.sql 2016-07-22 11:24:10 +0000
32@@ -3402,6 +3402,20 @@
33
34 ALTER TABLE distributionsourcepackage DISABLE TRIGGER ALL;
35
36+INSERT INTO distributionsourcepackage (id, distribution, sourcepackagename, bug_reporting_guidelines, max_bug_heat, bug_reported_acknowledgement, total_bug_heat, bug_count, po_message_count, is_upstream_link_allowed, enable_bugfiling_duplicate_search) VALUES (1, 1, 20, NULL, NULL, NULL, NULL, NULL, NULL, false, true);
37+INSERT INTO distributionsourcepackage (id, distribution, sourcepackagename, bug_reporting_guidelines, max_bug_heat, bug_reported_acknowledgement, total_bug_heat, bug_count, po_message_count, is_upstream_link_allowed, enable_bugfiling_duplicate_search) VALUES (2, 1, 26, NULL, NULL, NULL, NULL, NULL, NULL, false, true);
38+INSERT INTO distributionsourcepackage (id, distribution, sourcepackagename, bug_reporting_guidelines, max_bug_heat, bug_reported_acknowledgement, total_bug_heat, bug_count, po_message_count, is_upstream_link_allowed, enable_bugfiling_duplicate_search) VALUES (3, 1, 23, NULL, NULL, NULL, NULL, NULL, NULL, false, true);
39+INSERT INTO distributionsourcepackage (id, distribution, sourcepackagename, bug_reporting_guidelines, max_bug_heat, bug_reported_acknowledgement, total_bug_heat, bug_count, po_message_count, is_upstream_link_allowed, enable_bugfiling_duplicate_search) VALUES (4, 1, 9, NULL, NULL, NULL, NULL, NULL, NULL, false, true);
40+INSERT INTO distributionsourcepackage (id, distribution, sourcepackagename, bug_reporting_guidelines, max_bug_heat, bug_reported_acknowledgement, total_bug_heat, bug_count, po_message_count, is_upstream_link_allowed, enable_bugfiling_duplicate_search) VALUES (5, 1, 24, NULL, NULL, NULL, NULL, NULL, NULL, false, true);
41+INSERT INTO distributionsourcepackage (id, distribution, sourcepackagename, bug_reporting_guidelines, max_bug_heat, bug_reported_acknowledgement, total_bug_heat, bug_count, po_message_count, is_upstream_link_allowed, enable_bugfiling_duplicate_search) VALUES (6, 1, 22, NULL, NULL, NULL, NULL, NULL, NULL, false, true);
42+INSERT INTO distributionsourcepackage (id, distribution, sourcepackagename, bug_reporting_guidelines, max_bug_heat, bug_reported_acknowledgement, total_bug_heat, bug_count, po_message_count, is_upstream_link_allowed, enable_bugfiling_duplicate_search) VALUES (7, 1, 27, NULL, NULL, NULL, NULL, NULL, NULL, false, true);
43+INSERT INTO distributionsourcepackage (id, distribution, sourcepackagename, bug_reporting_guidelines, max_bug_heat, bug_reported_acknowledgement, total_bug_heat, bug_count, po_message_count, is_upstream_link_allowed, enable_bugfiling_duplicate_search) VALUES (8, 8, 19, NULL, NULL, NULL, NULL, NULL, NULL, false, true);
44+INSERT INTO distributionsourcepackage (id, distribution, sourcepackagename, bug_reporting_guidelines, max_bug_heat, bug_reported_acknowledgement, total_bug_heat, bug_count, po_message_count, is_upstream_link_allowed, enable_bugfiling_duplicate_search) VALUES (9, 1, 14, NULL, NULL, NULL, NULL, NULL, NULL, false, true);
45+INSERT INTO distributionsourcepackage (id, distribution, sourcepackagename, bug_reporting_guidelines, max_bug_heat, bug_reported_acknowledgement, total_bug_heat, bug_count, po_message_count, is_upstream_link_allowed, enable_bugfiling_duplicate_search) VALUES (10, 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, false, true);
46+INSERT INTO distributionsourcepackage (id, distribution, sourcepackagename, bug_reporting_guidelines, max_bug_heat, bug_reported_acknowledgement, total_bug_heat, bug_count, po_message_count, is_upstream_link_allowed, enable_bugfiling_duplicate_search) VALUES (11, 1, 21, NULL, NULL, NULL, NULL, NULL, NULL, false, true);
47+INSERT INTO distributionsourcepackage (id, distribution, sourcepackagename, bug_reporting_guidelines, max_bug_heat, bug_reported_acknowledgement, total_bug_heat, bug_count, po_message_count, is_upstream_link_allowed, enable_bugfiling_duplicate_search) VALUES (12, 3, 19, NULL, NULL, NULL, NULL, NULL, NULL, false, true);
48+INSERT INTO distributionsourcepackage (id, distribution, sourcepackagename, bug_reporting_guidelines, max_bug_heat, bug_reported_acknowledgement, total_bug_heat, bug_count, po_message_count, is_upstream_link_allowed, enable_bugfiling_duplicate_search) VALUES (13, 1, 10, NULL, NULL, NULL, NULL, NULL, NULL, false, true);
49+INSERT INTO distributionsourcepackage (id, distribution, sourcepackagename, bug_reporting_guidelines, max_bug_heat, bug_reported_acknowledgement, total_bug_heat, bug_count, po_message_count, is_upstream_link_allowed, enable_bugfiling_duplicate_search) VALUES (14, 1, 19, NULL, NULL, NULL, NULL, NULL, NULL, false, true);
50
51
52 ALTER TABLE distributionsourcepackage ENABLE TRIGGER ALL;