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
=== modified file 'database/sampledata/current-dev.sql'
--- database/sampledata/current-dev.sql 2010-02-04 11:12:20 +0000
+++ database/sampledata/current-dev.sql 2010-02-16 08:30:51 +0000
@@ -9062,13 +9062,6 @@
9062ALTER TABLE sourcepackagerecipebuildjob ENABLE TRIGGER ALL;9062ALTER TABLE sourcepackagerecipebuildjob ENABLE TRIGGER ALL;
90639063
90649064
9065ALTER TABLE sourcepackagerecipebuildupload DISABLE TRIGGER ALL;
9066
9067
9068
9069ALTER TABLE sourcepackagerecipebuildupload ENABLE TRIGGER ALL;
9070
9071
9072ALTER TABLE sourcepackagerecipedata DISABLE TRIGGER ALL;9065ALTER TABLE sourcepackagerecipedata DISABLE TRIGGER ALL;
90739066
90749067
90759068
=== modified file 'database/sampledata/current.sql'
--- database/sampledata/current.sql 2010-02-04 11:12:20 +0000
+++ database/sampledata/current.sql 2010-02-16 08:30:51 +0000
@@ -8948,13 +8948,6 @@
8948ALTER TABLE sourcepackagerecipebuildjob ENABLE TRIGGER ALL;8948ALTER TABLE sourcepackagerecipebuildjob ENABLE TRIGGER ALL;
89498949
89508950
8951ALTER TABLE sourcepackagerecipebuildupload DISABLE TRIGGER ALL;
8952
8953
8954
8955ALTER TABLE sourcepackagerecipebuildupload ENABLE TRIGGER ALL;
8956
8957
8958ALTER TABLE sourcepackagerecipedata DISABLE TRIGGER ALL;8951ALTER TABLE sourcepackagerecipedata DISABLE TRIGGER ALL;
89598952
89608953
89618954
=== modified file 'database/schema/comments.sql'
--- database/schema/comments.sql 2010-02-15 13:33:06 +0000
+++ database/schema/comments.sql 2010-02-16 08:30:52 +0000
@@ -1344,16 +1344,10 @@
1344COMMENT 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.';1344COMMENT 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.';
1345COMMENT ON COLUMN SourcePackageRecipeBuild.requester IS 'Who requested the build.';1345COMMENT ON COLUMN SourcePackageRecipeBuild.requester IS 'Who requested the build.';
1346COMMENT ON COLUMN SourcePackageRecipeBuild.recipe IS 'The recipe being processed.';1346COMMENT ON COLUMN SourcePackageRecipeBuild.recipe IS 'The recipe being processed.';
1347COMMENT ON COLUMN SourcePackageRecipeBuild.archive IS 'The archive the source package will be uploaded to.';1347COMMENT ON COLUMN SourcePackageRecipeBuild.archive IS 'The archive the source package will be built in and uploaded to.';
13481348COMMENT ON COLUMN SourcePackageRecipeBuild.pocket IS 'The pocket the source package will be built in and uploaded to.';
1349-- SourcePackageRecipeBuildUpload1349COMMENT ON COLUMN SourcePackageRecipeBuild.dependencies IS 'The missing build dependencies, if any.';
13501350COMMENT ON COLUMN SourcePackageRecipeBuild.upload_log IS 'The output from uploading the source package to the archive.';
1351COMMENT ON TABLE SourcePackageRecipeBuildUpload IS 'The record of uploading the source package built by a SourcePackageRecipeBuild to an archive.';
1352COMMENT ON COLUMN SourcePackageRecipeBuildUpload.registrant IS 'Who requested the upload.';
1353COMMENT ON COLUMN SourcePackageRecipeBuildUpload.sourcepackage_recipe_build IS 'Upload the output of this build.';
1354COMMENT ON COLUMN SourcePackageRecipeBuildUpload.archive IS 'The archive to upload to.';
1355COMMENT ON COLUMN SourcePackageRecipeBuildUpload.upload_log IS 'The output from uploading the source package to the archive.';
1356COMMENT ON COLUMN SourcePackageRecipeBuildUpload.state IS 'The state of the upload.';
13571351
1358-- SourcePackageRecipeBuildJob1352-- SourcePackageRecipeBuildJob
13591353
13601354
=== added file 'database/schema/patch-2207-32-0.sql'
--- database/schema/patch-2207-32-0.sql 1970-01-01 00:00:00 +0000
+++ database/schema/patch-2207-32-0.sql 2010-02-16 08:30:52 +0000
@@ -0,0 +1,21 @@
1SET client_min_messages=ERROR;
2
3ALTER TABLE SourcePackageRecipeBuild ADD COLUMN dependencies text;
4ALTER TABLE SourcePackageRecipeBuild ADD COLUMN pocket integer
5 DEFAULT 0 NOT NULL;
6ALTER TABLE SourcePackageRecipeBuild ADD COLUMN upload_log integer
7 CONSTRAINT sourcepackagerecipebuild__upload_log__fk
8 REFERENCES LibraryFileAlias;
9
10CREATE INDEX sourcepackagerecipebuild__upload_log__idx
11 ON SourcePackageRecipeBuild(upload_log) WHERE upload_log IS NOT NULL;
12
13-- We can't drop tables in DB patches due to Slony-I limitations, so
14-- we give them a magic name for database/schema/upgrade.py to deal
15-- with correctly.
16-- Drop the constraint right now so the person privacy checker doesn't
17-- look at this table at all.
18ALTER TABLE SourcePackageRecipeBuildUpload DROP CONSTRAINT sourcepackagerecipebuildupload_registrant_fkey;
19ALTER TABLE SourcePackageRecipeBuildUpload SET SCHEMA todrop;
20
21INSERT INTO LaunchpadDatabaseRevision VALUES (2207, 32, 0);
022
=== modified file 'database/schema/security.cfg'
--- database/schema/security.cfg 2010-02-15 13:33:06 +0000
+++ database/schema/security.cfg 2010-02-16 08:30:52 +0000
@@ -281,7 +281,6 @@
281public.sourcepackagerecipe = SELECT, INSERT, UPDATE, DELETE281public.sourcepackagerecipe = SELECT, INSERT, UPDATE, DELETE
282public.sourcepackagerecipebuild = SELECT, INSERT, UPDATE, DELETE282public.sourcepackagerecipebuild = SELECT, INSERT, UPDATE, DELETE
283public.sourcepackagerecipebuildjob = SELECT, INSERT, UPDATE283public.sourcepackagerecipebuildjob = SELECT, INSERT, UPDATE
284public.sourcepackagerecipebuildupload = SELECT, INSERT, UPDATE, DELETE
285public.sourcepackagerecipedata = SELECT, INSERT, UPDATE, DELETE284public.sourcepackagerecipedata = SELECT, INSERT, UPDATE, DELETE
286public.sourcepackagerecipedatainstruction = SELECT, INSERT, UPDATE, DELETE285public.sourcepackagerecipedatainstruction = SELECT, INSERT, UPDATE, DELETE
287public.specificationbranch = SELECT, INSERT, UPDATE, DELETE286public.specificationbranch = SELECT, INSERT, UPDATE, DELETE
@@ -413,7 +412,6 @@
413public.sprint = SELECT412public.sprint = SELECT
414public.sourcepackagereleasefile = SELECT413public.sourcepackagereleasefile = SELECT
415public.sourcepackagerecipebuild = SELECT414public.sourcepackagerecipebuild = SELECT
416public.sourcepackagerecipebuildupload = SELECT
417public.temporaryblobstorage = SELECT, DELETE415public.temporaryblobstorage = SELECT, DELETE
418public.translationimportqueueentry = SELECT416public.translationimportqueueentry = SELECT
419417

Subscribers

People subscribed via source and target branches

to status/vote changes: