Merge lp:~wgrant/launchpad/sprbu-columns-to-sprb into lp:launchpad/db-devel

Proposed by William Grant
Status: Merged
Approved by: Björn Tillenius
Approved revision: not available
Merged at revision: not available
Proposed branch: lp:~wgrant/launchpad/sprbu-columns-to-sprb
Merge into: lp:launchpad/db-devel
Diff against target: 105 lines (+25/-26)
5 files modified
database/sampledata/current-dev.sql (+0/-7)
database/sampledata/current.sql (+0/-7)
database/schema/comments.sql (+4/-10)
database/schema/patch-2207-32-0.sql (+21/-0)
database/schema/security.cfg (+0/-2)
To merge this branch: bzr merge lp:~wgrant/launchpad/sprbu-columns-to-sprb
Reviewer Review Type Date Requested Status
Björn Tillenius (community) db Approve
Stuart Bishop (community) db Approve
Julian Edwards (community) Approve
Jonathan Lange (community) Abstain
Review via email: mp+18995@code.launchpad.net

Commit message

Drop SourcePackageRecipeBuildUpload, and move its useful attributes onto SourcePackageRecipeBuild.

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

We need some new attributes on SourcePackageRecipeBuild:

 - pocket -- just like on Build, currently hardcoded to RELEASE in the model.
 - dependencies -- just like on Build, to store missing build dependencies.
 - upload_log -- just like on Build, to store the upload log. This was on SourcePackageRecipeBuildUpload, which we're not using for now.

Revision history for this message
Jonathan Lange (jml) wrote :

Thanks William.

It looks good to me and the changes seem sane, but I don't really feel competent to review it -- the details of the model have flown out of my head. Could you please ask Julian or Michael H or someone else to review this?

review: Abstain
Revision history for this message
Julian Edwards (julian-edwards) wrote :

It looks fine to me from a model PoV.

review: Approve
Revision history for this message
Stuart Bishop (stub) wrote :

I'm unsure of upload_log. Dropping this column in the future and migrating its information to SourcePackageRecipeBuildUpload seems more work than just creating the SourcePackageRecipeBuildUpload records.

We should either drop this column from the patch and create SourcePackageRecipeBuildUpload records, or add a comment stating that the column is temporary and add the needed index with "CREATE INDEX sourcepackagerecipiebuild__upload_log__idx ON SourcepackageRecipieBuild(upload_log);"

review: Needs Information (db)
Revision history for this message
William Grant (wgrant) wrote :

It's unclear whether we will ever use SourcePackageRecipeBuildUpload -- any uses for it are not obvious. It's easy to migrate to it if we ever need to.

What's the purpose of the index? I can't imagine any practical query in which it would be useful.

Revision history for this message
Stuart Bishop (stub) wrote :

Discussed with bigjools, so SourcepackageRecipeBuildUpload should go. The following patch is approved as patch-2207-32-0.sql. It will need the latest db-devel to work (I just noticed the todrop schema doesn't exist in developer databases any more, stopping us dropping tables). If dropping the table causes test failures you can't be bothered fixing, feel free to comment out that line and open a bug instead.

SET client_min_messages=ERROR;

ALTER TABLE SourcePackageRecipeBuild ADD COLUMN dependencies text;
ALTER TABLE SourcePackageRecipeBuild ADD COLUMN pocket integer
    DEFAULT 0 NOT NULL;
ALTER TABLE SourcePackageRecipeBuild ADD COLUMN upload_log integer
    CONSTRAINT sourcepackagerecipebuild__upload_log__fk
    REFERENCES LibraryFileAlias;

CREATE INDEX sourcepackagerecipebuild__upload_log__idx
    ON SourcePackageRecipeBuild(upload_log) WHERE upload_log IS NOT NULL;

-- We can't drop tables in DB patches due to Slony-I limitations, so
-- we give them a magic name for database/schema/upgrade.py to deal
-- with correctly.
ALTER TABLE SourcePackageRecipeBuildUpload SET SCHEMA todrop;

INSERT INTO LaunchpadDatabaseRevision VALUES (2207, 32, 0);

review: Approve (db)
Revision history for this message
Björn Tillenius (bjornt) wrote :

Looks good. You still have a '--- SourcePackageRecipeBuildUpload' in comments.sql, though.

review: Approve (db)
Revision history for this message
William Grant (wgrant) wrote :

I actually don't have that -- it's a glitch in the diff highlighting. It's really the removal of '-- SourcePackageRecipeBuildUpload'.

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 2010-02-04 11:12:20 +0000
3+++ database/sampledata/current-dev.sql 2010-02-16 08:30:51 +0000
4@@ -9062,13 +9062,6 @@
5 ALTER TABLE sourcepackagerecipebuildjob ENABLE TRIGGER ALL;
6
7
8-ALTER TABLE sourcepackagerecipebuildupload DISABLE TRIGGER ALL;
9-
10-
11-
12-ALTER TABLE sourcepackagerecipebuildupload ENABLE TRIGGER ALL;
13-
14-
15 ALTER TABLE sourcepackagerecipedata DISABLE TRIGGER ALL;
16
17
18
19=== modified file 'database/sampledata/current.sql'
20--- database/sampledata/current.sql 2010-02-04 11:12:20 +0000
21+++ database/sampledata/current.sql 2010-02-16 08:30:51 +0000
22@@ -8948,13 +8948,6 @@
23 ALTER TABLE sourcepackagerecipebuildjob ENABLE TRIGGER ALL;
24
25
26-ALTER TABLE sourcepackagerecipebuildupload DISABLE TRIGGER ALL;
27-
28-
29-
30-ALTER TABLE sourcepackagerecipebuildupload ENABLE TRIGGER ALL;
31-
32-
33 ALTER TABLE sourcepackagerecipedata DISABLE TRIGGER ALL;
34
35
36
37=== modified file 'database/schema/comments.sql'
38--- database/schema/comments.sql 2010-02-15 13:33:06 +0000
39+++ database/schema/comments.sql 2010-02-16 08:30:52 +0000
40@@ -1344,16 +1344,10 @@
41 COMMENT ON COLUMN SourcePackageRecipeBuild.date_first_dispatched IS 'The instant the build was dispatched the first time. This value will not get overridden if the build is retried.';
42 COMMENT ON COLUMN SourcePackageRecipeBuild.requester IS 'Who requested the build.';
43 COMMENT ON COLUMN SourcePackageRecipeBuild.recipe IS 'The recipe being processed.';
44-COMMENT ON COLUMN SourcePackageRecipeBuild.archive IS 'The archive the source package will be uploaded to.';
45-
46--- SourcePackageRecipeBuildUpload
47-
48-COMMENT ON TABLE SourcePackageRecipeBuildUpload IS 'The record of uploading the source package built by a SourcePackageRecipeBuild to an archive.';
49-COMMENT ON COLUMN SourcePackageRecipeBuildUpload.registrant IS 'Who requested the upload.';
50-COMMENT ON COLUMN SourcePackageRecipeBuildUpload.sourcepackage_recipe_build IS 'Upload the output of this build.';
51-COMMENT ON COLUMN SourcePackageRecipeBuildUpload.archive IS 'The archive to upload to.';
52-COMMENT ON COLUMN SourcePackageRecipeBuildUpload.upload_log IS 'The output from uploading the source package to the archive.';
53-COMMENT ON COLUMN SourcePackageRecipeBuildUpload.state IS 'The state of the upload.';
54+COMMENT ON COLUMN SourcePackageRecipeBuild.archive IS 'The archive the source package will be built in and uploaded to.';
55+COMMENT ON COLUMN SourcePackageRecipeBuild.pocket IS 'The pocket the source package will be built in and uploaded to.';
56+COMMENT ON COLUMN SourcePackageRecipeBuild.dependencies IS 'The missing build dependencies, if any.';
57+COMMENT ON COLUMN SourcePackageRecipeBuild.upload_log IS 'The output from uploading the source package to the archive.';
58
59 -- SourcePackageRecipeBuildJob
60
61
62=== added file 'database/schema/patch-2207-32-0.sql'
63--- database/schema/patch-2207-32-0.sql 1970-01-01 00:00:00 +0000
64+++ database/schema/patch-2207-32-0.sql 2010-02-16 08:30:52 +0000
65@@ -0,0 +1,21 @@
66+SET client_min_messages=ERROR;
67+
68+ALTER TABLE SourcePackageRecipeBuild ADD COLUMN dependencies text;
69+ALTER TABLE SourcePackageRecipeBuild ADD COLUMN pocket integer
70+ DEFAULT 0 NOT NULL;
71+ALTER TABLE SourcePackageRecipeBuild ADD COLUMN upload_log integer
72+ CONSTRAINT sourcepackagerecipebuild__upload_log__fk
73+ REFERENCES LibraryFileAlias;
74+
75+CREATE INDEX sourcepackagerecipebuild__upload_log__idx
76+ ON SourcePackageRecipeBuild(upload_log) WHERE upload_log IS NOT NULL;
77+
78+-- We can't drop tables in DB patches due to Slony-I limitations, so
79+-- we give them a magic name for database/schema/upgrade.py to deal
80+-- with correctly.
81+-- Drop the constraint right now so the person privacy checker doesn't
82+-- look at this table at all.
83+ALTER TABLE SourcePackageRecipeBuildUpload DROP CONSTRAINT sourcepackagerecipebuildupload_registrant_fkey;
84+ALTER TABLE SourcePackageRecipeBuildUpload SET SCHEMA todrop;
85+
86+INSERT INTO LaunchpadDatabaseRevision VALUES (2207, 32, 0);
87
88=== modified file 'database/schema/security.cfg'
89--- database/schema/security.cfg 2010-02-15 13:33:06 +0000
90+++ database/schema/security.cfg 2010-02-16 08:30:52 +0000
91@@ -281,7 +281,6 @@
92 public.sourcepackagerecipe = SELECT, INSERT, UPDATE, DELETE
93 public.sourcepackagerecipebuild = SELECT, INSERT, UPDATE, DELETE
94 public.sourcepackagerecipebuildjob = SELECT, INSERT, UPDATE
95-public.sourcepackagerecipebuildupload = SELECT, INSERT, UPDATE, DELETE
96 public.sourcepackagerecipedata = SELECT, INSERT, UPDATE, DELETE
97 public.sourcepackagerecipedatainstruction = SELECT, INSERT, UPDATE, DELETE
98 public.specificationbranch = SELECT, INSERT, UPDATE, DELETE
99@@ -413,7 +412,6 @@
100 public.sprint = SELECT
101 public.sourcepackagereleasefile = SELECT
102 public.sourcepackagerecipebuild = SELECT
103-public.sourcepackagerecipebuildupload = SELECT
104 public.temporaryblobstorage = SELECT, DELETE
105 public.translationimportqueueentry = SELECT
106

Subscribers

People subscribed via source and target branches

to status/vote changes: