Merge lp:~mwhudson/launchpad/recipe-db-schema into lp:launchpad/db-devel

Proposed by Michael Hudson-Doyle
Status: Merged
Approved by: Michael Hudson-Doyle
Approved revision: not available
Merged at revision: not available
Proposed branch: lp:~mwhudson/launchpad/recipe-db-schema
Merge into: lp:launchpad/db-devel
Diff against target: 300 lines (+227/-0)
6 files modified
database/schema/comments.sql (+62/-0)
database/schema/patch-2207-25-0.sql (+149/-0)
database/schema/security.cfg (+7/-0)
lib/lp/code/doc/branch.txt (+2/-0)
lib/lp/code/model/branch.py (+1/-0)
lib/lp/registry/model/person.py (+6/-0)
To merge this branch: bzr merge lp:~mwhudson/launchpad/recipe-db-schema
Reviewer Review Type Date Requested Status
Stuart Bishop (community) db Approve
Jonathan Lange (community) Approve
Review via email: mp+16268@code.launchpad.net

Commit message

The database tables for the SourcePackageRecipe build work.

To post a comment you must log in.
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Hi there,

This branch adds the db schema for sourcepackagerecipes and associated things that was much discussed on the list. I've written a little code using this schema now (see lp:~mwhudson/launchpad/recipe-model-code) and it still feels more or less right and I would like to start landing code, so now seems like a good time to get this branch formally reviewed.

This presupposes a fairly boring way of representing recipes in the database -- but I think that this will be easier to change if we want to later.

Cheers,
mwh

Revision history for this message
Muharem Hrnjadovic (al-maisan) wrote :

Hello there!

I understood that manifests need to store the revision for each referenced branch. I don't see that detail addressed in the schema change. Or did I miss something?

Revision history for this message
Muharem Hrnjadovic (al-maisan) wrote :

I read through the "First cut at recipe db-schema patch" email thread again..

Just in case you plan to keep the revision data for manifests in the SourcePackageRecipeData.recipe text column: how do we distinguish between recipe and manifest data w/o looking at the .recipe content or checking that it was referenced via SourcePackageBuild.manifest?

Or is there no need for such a distinction?

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Muharem Hrnjadovic wrote:
> I read through the "First cut at recipe db-schema patch" email thread again..
>
> Just in case you plan to keep the revision data for manifests in the SourcePackageRecipeData.recipe text column: how do we distinguish between recipe and manifest data w/o looking at the .recipe content or checking that it was referenced via SourcePackageBuild.manifest?

I guess I was expecting that you wouldn't do a big query for all
SourcePackageRecipeData rows referencing a branch and the split them
into recipe and manifest links but rather do two queries, one for
recipes referencing a branch and then one for manifests/build logs
referencing a branch. In my model code currently, there is no interface
for SourcePackageRecipeData -- it's hidden within the
SourcePackageRecipe content type.

> Or is there no need for such a distinction?

I don't really think there is.

Cheers,
mwh

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Muharem Hrnjadovic wrote:
> Hello there!
>
> I understood that manifests need to store the revision for each referenced branch. I don't see that detail addressed in the schema change. Or did I miss something?

Oh whoops, forgot about that.

I think I'm gradually coming around to Jono's view that we'll have
fairly structured storage of the recipe in the db, so all this will
probably change quite a bit before we start using it in anger.

Cheers,
mwh

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

I'm curious why SourcePackageRecipeData is a seperate table.

If this is a 1:1 relationship, do you have a rationale for this being a separate table?

If this is not a 1:1 relationship, how do we express this in English? A SourcePackageRecipe contains multiple recipes?

I'm happy to have the non-structured recipe column provided we don't need to do anything with it besides store it, retrieve it, and send it to builders. If the appservers need to decode it we should consider a more structured format per Jono's reported views.

SourcePackageBuild.sourcepackagename is misspelled.

The SourcePackageRecipe unique index does not match its name. Do you want (owner, distroseries, sourcepackagename, name) unique or just (distroseries, sourcepackagename, name)? I prefer ALTER TABLE ADD CONSTRAINT sourcepackagerecipe__ds__spn__name__key UNIQUE (distroseries, sourcepackagename, name) to CREATE UNIQUE INDEX, as we get a little more metadata in the DB with the former syntax (functionally, it is identical though except for some DBA operations).

It is going to need more indexes - pretty much every foreign key constraint needs an index on that column. I can add these in later if you want. We also will probably need indexes on SourcePackageBuild and SourcePackageBuildUpload to support queries required by our reports - we can add them in now if this is obvious, or leave them until later if we don't know what the selection criteria will be.

review: Needs Resubmitting (db)
Revision history for this message
Jonathan Lange (jml) wrote :

Michael and I had a chat on the phone. We've worked out a schema that will have a much more structured view of recipes. Should be up for review again tomorrow.

review: Needs Resubmitting
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Hi guys, I think the patch is now ready and we'd like to land it before It will still need indexes added, but I hope stub can do that :-)

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

 * 'name' on SPRInstruction should be NOT NULL, I think.
 * You _could_ add a constraint saying that the line number should be strictly greater than the parent's line number. Not sure if this is necessary.
 * Shouldn't SourcePackageBuild.recipe be NOT NULL?

Other than that, looks good.

review: Needs Fixing
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

* OK.
* Doesn't seem useful really
* OK.

Go again?

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

Wuu.

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

Allocated patch number is patch-2207-25-0.sql

SourcePackageRecipeDataInstruction.recipe_data should be NOT NULL

The sourcepackagerecipedatainstruction__name__recipe_data should be called
sourcepackagerecipedatainstruction__name__recipe_data__key. Similarly other unique constraints should end with __key.

Please change:

ALTER TABLE SourcePackageRecipeDataInstruction
ADD CONSTRAINT sourcepackagerecipedatainstruction__line_number__recipe_data
UNIQUE (line_number, recipe_data);

into the more useful to PostgreSQL variant:

ALTER TABLE SourcePackageRecipeDataInstruction ADD CONSTRAINT
sourcepackagerecipedatainstruction__recipe_data__line_number__key
UNIQUE (recipe_data, line_number);

sourcepackage is one word in Launchpad, so the .*source_package.* columns
need to be renamed .*sourcepackage.*.

As discussed on IRC and seen at http://pastebin.ubuntu.com/355335/, its better to make SourcepackageRecipeData reference recipe and build rather than the other way around, as we can then enforce the constraint that one and only one should be set.

Needed indexes:

CREATE INDEX sourcepackagerecipedata__base_branch__idx
ON SourcepackageRecipeData(base_branch);

CREATE INDEX sourcepackagerecipedatainstruction__branch__idx
ON SourcepackageRecipeDataInstruction(branch);

CREATE INDEX sourcepackagerecipe__registrant__idx
ON SourcepackageRecipe(registrant);

--CREATE INDEX sourcepackagerecipe__owner__idx
--ON SourcepackageRecipe(owner);

CREATE INDEX sourcepackagerecipebuild__distroseries__idx
ON SourcepackageRecipeBuild(distroseries);

CREATE INDEX sourcepackagerecipebuild__sourcepackagename__idx
ON SourcepackageRecipeBuild(sourcepackagename);

CREATE INDEX sourcepackagerecipebuild__build_log__idx
ON SourcepackageRecipeBuild(build_log) WHERE build_log IS NOT NULL;

CREATE INDEX sourcepackagerecipebuild__builder__idx
ON SourcepackageRecipeBuild(builder);

CREATE INDEX sourcepackagerecipebuild__requester__idx
ON SourcepackageRecipeBuild(requester);

CREATE INDEX sourcepackagerecipebuild__recipe__idx
ON SourcepackageRecipeBuild(recipe);

CREATE INDEX sourcepackagebuildupload__registrant__idx
ON SourcepackageRecipeBuildUpload(registrant);

review: Needs Fixing (db)
Revision history for this message
Stuart Bishop (stub) wrote :

I missed some indexes and one of the constraints is wrong.

CREATE INDEX sourcepackagerecipebuildupload__archive__idx
ON SourcepackageRecipeBuildUpload(archive);

CREATE INDEX sourcepackagerecipebuildupload__upload_log__idx
ON SourcepackageRecipeBuildUpload(upload_log) WHERE upload_log IS NOT NULL;

CREATE INDEX sourcepackagerelease__sourcepackage_recipe_build__idx
ON SourcepackageRelease(sourcepackage_recipe_build);

Should BuildSourcepackageFromRecipe.job be UNIQUE? If so:

ALTER TABLE BuildSourcepackageFromRecipe ADD CONSTRAINT
buildsourcepackagefromrecipe__job__key UNIQUE (job);

Otherwise:

CREATE INDEX buildsourcepackagefromrecipe__job__idx
ON BuildSourcepackageFromRecipe(job);

One of the constraints is wrong (NULL != NULL in SQL 3-value boolean). Drop:

ALTER TABLE SourcePackageRecipeData ADD CONSTRAINT
sourcepackagerecipedata__sourcepackage_recipe__sourcepackage_recipe_build__key
UNIQUE (sourcepackage_recipe, sourcepackage_recipe_build);

Replace with:

CREATE UNIQUE UNDEX sourcepackagerecipedata__sourcepackage_recipe__key
ON SourcepackageRecipeData(sourcepackage_recipe)
WHERE sourcepackage_recipe IS NOT NULL;
CREATE UNIQUE INDEX sourcepackagerecipedata__sourcepackage_recipe_build__key
ON SourcepackageRecipeData(sourcepackage_recipe_build)
WHERE sourcepackage_recipe_build IS NOT NULL;

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

W00t

review: Approve (db)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'database/schema/comments.sql'
--- database/schema/comments.sql 2010-01-11 04:46:04 +0000
+++ database/schema/comments.sql 2010-01-13 05:13:16 +0000
@@ -1288,7 +1288,69 @@
12881288
1289COMMENT ON TABLE SourcePackageName IS 'SourcePackageName: A soyuz source package name.';1289COMMENT ON TABLE SourcePackageName IS 'SourcePackageName: A soyuz source package name.';
12901290
1291-- SourcePackageRecipeData
1292
1293COMMENT ON TABLE SourcePackageRecipeData IS 'The database representation of a BaseRecipeBranch from bzr-builder. Exactly one of sourcepackage_recipe or sourcepackage_recipe_build will be non-NULL.';
1294COMMENT ON COLUMN SourcePackageRecipeData.base_branch IS 'The branch the recipe is based on.';
1295COMMENT ON COLUMN SourcePackageRecipeData.recipe_format IS 'The format version of the recipe.';
1296COMMENT ON COLUMN SourcePackageRecipeData.deb_version_template IS 'The template for the revision number of the build.';
1297COMMENT ON COLUMN SourcePackageRecipeData.revspec IS 'The revision from base_branch to use.';
1298COMMENT ON COLUMN SourcePackageRecipeData.sourcepackage_recipe IS 'The recipe that this data is for.';
1299COMMENT ON COLUMN SourcePackageRecipeData.sourcepackage_recipe_build IS 'The build that resulted in this manifest.';
1300
1301-- SourcePackageRecipeDataInstruction
1302
1303COMMENT ON TABLE SourcePackageRecipeDataInstruction IS 'A line from the recipe, specifying a branch to nest or merge.';
1304COMMENT ON COLUMN SourcePackageRecipeDataInstruction.name IS 'The name of the instruction.';
1305COMMENT ON COLUMN SourcePackageRecipeDataInstruction.type IS 'The type of the instruction (MERGE == 1, NEST == 2).';
1306COMMENT ON COLUMN SourcePackageRecipeDataInstruction.comment IS 'The comment from the recipe about this instruction.';
1307COMMENT ON COLUMN SourcePackageRecipeDataInstruction.line_number IS 'The line number of the instruction in the recipe.';
1308COMMENT ON COLUMN SourcePackageRecipeDataInstruction.branch IS 'The branch being merged or nested.';
1309COMMENT ON COLUMN SourcePackageRecipeDataInstruction.revspec IS 'The revision of the branch to use.';
1310COMMENT ON COLUMN SourcePackageRecipeDataInstruction.directory IS 'The location to nest at, if this is a nest instruction.';
1311COMMENT ON COLUMN SourcePackageRecipeDataInstruction.recipe_data IS 'The SourcePackageRecipeData this instruction is part of.';
1312COMMENT ON COLUMN SourcePackageRecipeDataInstruction.parent_instruction IS 'The nested branch this instruction applies to, or NULL for a top-level instruction.';
1313
1314-- SourcePackageRecipe
1315
1316COMMENT ON TABLE SourcePackageRecipe IS 'A recipe for assembling a source package from branches.';
1317COMMENT ON COLUMN SourcePackageRecipe.registrant IS 'The person who created this recipe.';
1318COMMENT ON COLUMN SourcePackageRecipe.owner IS 'The person or team who can edit this recipe.';
1319COMMENT ON COLUMN SourcePackageRecipe.distroseries IS 'The distroseries this recipe builds a package for.';
1320COMMENT ON COLUMN SourcePackageRecipe.sourcepackagename IS 'The name of the source package this recipe builds.';
1321COMMENT ON COLUMN SourcePackageRecipe.name IS 'The name of the recipe in the web/URL.';
1322
1323-- SourcePackageRecipeBuild
1324
1325COMMENT ON TABLE SourcePackageRecipeBuild IS 'The build record for the process of building a source package as described by a recipe.';
1326COMMENT ON COLUMN SourcePackageRecipeBuild.distroseries IS 'The distroseries the build was for.';
1327COMMENT ON COLUMN SourcePackageRecipeBuild.sourcepackagename IS 'The name of the source package that was built.';
1328COMMENT ON COLUMN SourcePackageRecipeBuild.build_state IS 'The state of the build.';
1329COMMENT ON COLUMN SourcePackageRecipeBuild.date_built IS 'When the build record was processed.';
1330COMMENT ON COLUMN SourcePackageRecipeBuild.build_duration IS 'How long this build took to be processed.';
1331COMMENT ON COLUMN SourcePackageRecipeBuild.build_log IS 'Points to the build_log file stored in librarian.';
1332COMMENT ON COLUMN SourcePackageRecipeBuild.builder IS 'Points to the builder which has once processed it.';
1333COMMENT 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.';
1334COMMENT ON COLUMN SourcePackageRecipeBuild.requester IS 'Who requested the build.';
1335COMMENT ON COLUMN SourcePackageRecipeBuild.recipe IS 'The recipe being processed.';
1336COMMENT ON COLUMN SourcePackageRecipeBuild.archive IS 'The archive the source package will be uploaded to.';
1337
1338-- SourcePackageRecipeBuildUpload
1339
1340COMMENT ON TABLE SourcePackageRecipeBuildUpload IS 'The record of uploading the source package built by a SourcePackageRecipeBuild to an archive.';
1341COMMENT ON COLUMN SourcePackageRecipeBuildUpload.registrant IS 'Who requested the upload.';
1342COMMENT ON COLUMN SourcePackageRecipeBuildUpload.sourcepackage_recipe_build IS 'Upload the output of this build.';
1343COMMENT ON COLUMN SourcePackageRecipeBuildUpload.archive IS 'The archive to upload to.';
1344COMMENT ON COLUMN SourcePackageRecipeBuildUpload.upload_log IS 'The output from uploading the source package to the archive.';
1345COMMENT ON COLUMN SourcePackageRecipeBuildUpload.state IS 'The state of the upload.';
1346
1347-- SourcePackageRecipeBuildJob
1348
1349COMMENT ON TABLE SourcePackageRecipeBuildJob IS 'The link between a SourcePackageRecipeBuild row and a Job row to schedule a build of a source package recipe.';
1350COMMENT ON COLUMN SourcePackageRecipeBuildJob.sourcepackage_recipe_build IS 'The build record describing the package being built.';
1351
1291-- Specification1352-- Specification
1353
1292COMMENT ON TABLE Specification IS 'A feature specification. At the moment we do not store the actual specification, we store a URL for the spec, which is managed in a wiki somewhere else. We store the overall state of the spec, as well as queueing information about who needs to review the spec, and why.';1354COMMENT ON TABLE Specification IS 'A feature specification. At the moment we do not store the actual specification, we store a URL for the spec, which is managed in a wiki somewhere else. We store the overall state of the spec, as well as queueing information about who needs to review the spec, and why.';
1293COMMENT ON COLUMN Specification.assignee IS 'The person who has been assigned to implement this specification.';1355COMMENT ON COLUMN Specification.assignee IS 'The person who has been assigned to implement this specification.';
1294COMMENT ON COLUMN Specification.drafter IS 'The person who has been asked to draft this specification. They are responsible for getting the spec to "approved" state.';1356COMMENT ON COLUMN Specification.drafter IS 'The person who has been asked to draft this specification. They are responsible for getting the spec to "approved" state.';
12951357
=== added file 'database/schema/patch-2207-25-0.sql'
--- database/schema/patch-2207-25-0.sql 1970-01-01 00:00:00 +0000
+++ database/schema/patch-2207-25-0.sql 2010-01-13 05:13:16 +0000
@@ -0,0 +1,149 @@
1SET client_min_messages=ERROR;
2
3CREATE TABLE SourcePackageRecipe (
4 id serial PRIMARY KEY,
5 date_created timestamp without time zone DEFAULT timezone('UTC'::text, now()) NOT NULL,
6 date_last_modified timestamp without time zone DEFAULT timezone('UTC'::text, now()) NOT NULL,
7 registrant integer NOT NULL REFERENCES Person,
8 owner integer NOT NULL REFERENCES Person,
9 distroseries integer NOT NULL REFERENCES DistroSeries,
10 sourcepackagename integer NOT NULL REFERENCES SourcePackageName,
11 name text NOT NULL
12);
13
14ALTER TABLE SourcePackageRecipe ADD CONSTRAINT sourcepackagerecipe__owner__distroseries__sourcepackagename__name__key
15 UNIQUE (owner, distroseries, sourcepackagename, name);
16
17CREATE TABLE SourcePackageRecipeBuild (
18 id serial PRIMARY KEY,
19 -- most of this is just copied from Build
20
21 -- I've dropped: processor, sourcepackagerelease, pocket, dependencies
22 -- changed: distroarchseries to distroseries
23 -- added: recipe and manifest
24 date_created timestamp without time zone DEFAULT timezone('UTC'::text, ('now'::text)::timestamp(6) with time zone) NOT NULL,
25 distroseries integer NOT NULL REFERENCES distroseries,
26 sourcepackagename integer NOT NULL REFERENCES SourcePackageName,
27 build_state integer NOT NULL,
28 date_built timestamp without time zone,
29 build_duration interval,
30 build_log integer REFERENCES libraryfilealias,
31 builder integer REFERENCES builder,
32 date_first_dispatched timestamp without time zone,
33 requester integer NOT NULL REFERENCES Person,
34 recipe integer REFERENCES SourcePackageRecipe NOT NULL,
35 archive integer NOT NULL REFERENCES Archive
36);
37
38CREATE TABLE SourcePackageRecipeBuildUpload (
39 id serial PRIMARY KEY,
40 date_created timestamp without time zone DEFAULT timezone('UTC'::text, ('now'::text)::timestamp(6) with time zone) NOT NULL,
41 registrant integer NOT NULL REFERENCES Person,
42 sourcepackage_recipe_build integer NOT NULL REFERENCES SourcePackageRecipeBuild,
43 archive integer NOT NULL REFERENCES Archive,
44 upload_log integer REFERENCES LibraryFileAlias,
45 state integer NOT NULL -- an enum, WAITING/UPLOADED/FAILED or something like that.
46);
47
48-- indexes for SourcePackageRecipeBuildUpload I guess
49
50ALTER TABLE SourcePackageRelease
51 ADD COLUMN sourcepackage_recipe_build integer REFERENCES SourcePackageRecipeBuild;
52
53CREATE TABLE SourcePackageRecipeBuildJob (
54 id serial PRIMARY KEY,
55 job integer NOT NULL REFERENCES Job,
56 sourcepackage_recipe_build integer REFERENCES SourcePackageRecipeBuild
57);
58
59ALTER TABLE SourcePackageRecipeBuildJob ADD CONSTRAINT sourcepackagerecipebuildjob__sourcepackage_recipe_build__key
60 UNIQUE (sourcepackage_recipe_build);
61
62ALTER TABLE SourcePackageRecipeBuildJob ADD CONSTRAINT sourcepackagerecipebuildjob__job__key
63 UNIQUE (job);
64
65CREATE TABLE SourcePackageRecipeData (
66 id serial PRIMARY KEY,
67 base_branch integer NOT NULL REFERENCES Branch,
68 recipe_format text NOT NULL,
69 deb_version_template text NOT NULL,
70 revspec text,
71 sourcepackage_recipe integer REFERENCES SourcePackageRecipe,
72 sourcepackage_recipe_build integer REFERENCES SourcePackageRecipeBuild
73);
74
75ALTER TABLE SourcePackageRecipeData ADD CONSTRAINT sourcepackagerecipedata__recipe_or_build_is_not_null
76 CHECK (sourcepackage_recipe IS NULL != sourcepackage_recipe_build IS NULL);
77CREATE UNIQUE INDEX sourcepackagerecipedata__sourcepackage_recipe__key
78 ON SourcepackageRecipeData(sourcepackage_recipe)
79 WHERE sourcepackage_recipe IS NOT NULL;
80CREATE UNIQUE INDEX sourcepackagerecipedata__sourcepackage_recipe_build__key
81 ON SourcepackageRecipeData(sourcepackage_recipe_build)
82 WHERE sourcepackage_recipe_build IS NOT NULL;
83
84CREATE TABLE SourcePackageRecipeDataInstruction (
85 id serial PRIMARY KEY,
86 name text NOT NULL,
87 type integer NOT NULL, -- MERGE == 1, NEST == 2
88 comment text,
89 line_number integer NOT NULL,
90 branch integer NOT NULL REFERENCES Branch,
91 revspec text,
92 directory text,
93 recipe_data integer NOT NULL REFERENCES SourcePackageRecipeData,
94 parent_instruction integer REFERENCES SourcePackageRecipeDataInstruction
95);
96
97ALTER TABLE SourcePackageRecipeDataInstruction ADD CONSTRAINT sourcepackagerecipedatainstruction__name__recipe_data__key
98 UNIQUE (name, recipe_data);
99ALTER TABLE SourcePackageRecipeDataInstruction ADD CONSTRAINT sourcepackagerecipedatainstruction__recipe_data__line_number__key
100 UNIQUE (recipe_data, line_number);
101ALTER TABLE SourcePackageRecipeDataInstruction ADD CONSTRAINT sourcepackagerecipedatainstruction__directory_not_null
102 CHECK ((type = 1 AND directory IS NULL) OR (type = 2 AND directory IS NOT NULL));
103
104CREATE INDEX sourcepackagerecipedata__base_branch__idx
105ON SourcepackageRecipeData(base_branch);
106
107CREATE INDEX sourcepackagerecipedatainstruction__branch__idx
108ON SourcepackageRecipeDataInstruction(branch);
109
110CREATE INDEX sourcepackagerecipe__registrant__idx
111ON SourcepackageRecipe(registrant);
112
113--CREATE INDEX sourcepackagerecipe__owner__idx
114--ON SourcepackageRecipe(owner);
115
116CREATE INDEX sourcepackagerecipebuild__distroseries__idx
117ON SourcepackageRecipeBuild(distroseries);
118
119CREATE INDEX sourcepackagerecipebuild__sourcepackagename__idx
120ON SourcepackageRecipeBuild(sourcepackagename);
121
122CREATE INDEX sourcepackagerecipebuild__build_log__idx
123ON SourcepackageRecipeBuild(build_log) WHERE build_log IS NOT NULL;
124
125CREATE INDEX sourcepackagerecipebuild__builder__idx
126ON SourcepackageRecipeBuild(builder);
127
128CREATE INDEX sourcepackagerecipebuild__requester__idx
129ON SourcepackageRecipeBuild(requester);
130
131CREATE INDEX sourcepackagerecipebuild__recipe__idx
132ON SourcepackageRecipeBuild(recipe);
133
134CREATE INDEX sourcepackagerecipebuild__archive__idx
135ON SourcepackageRecipeBuild(archive);
136
137CREATE INDEX sourcepackagebuildupload__registrant__idx
138ON SourcepackageRecipeBuildUpload(registrant);
139
140CREATE INDEX sourcepackagerecipebuildupload__archive__idx
141ON SourcepackageRecipeBuildUpload(archive);
142
143CREATE INDEX sourcepackagerecipebuildupload__upload_log__idx
144ON SourcepackageRecipeBuildUpload(upload_log) WHERE upload_log IS NOT NULL;
145
146CREATE INDEX sourcepackagerelease__sourcepackage_recipe_build__idx
147ON SourcepackageRelease(sourcepackage_recipe_build);
148
149INSERT INTO LaunchpadDatabaseRevision VALUES (2207, 25, 0);
0150
=== modified file 'database/schema/security.cfg'
--- database/schema/security.cfg 2010-01-06 14:25:01 +0000
+++ database/schema/security.cfg 2010-01-13 05:13:16 +0000
@@ -275,6 +275,11 @@
275public.sourcepackagepublishinghistory = SELECT275public.sourcepackagepublishinghistory = SELECT
276public.seriessourcepackagebranch = SELECT, INSERT, UPDATE, DELETE276public.seriessourcepackagebranch = SELECT, INSERT, UPDATE, DELETE
277public.sourcepackageformatselection = SELECT277public.sourcepackageformatselection = SELECT
278public.sourcepackagerecipe = SELECT, INSERT, UPDATE, DELETE
279public.sourcepackagerecipebuild = SELECT, INSERT, UPDATE, DELETE
280public.sourcepackagerecipebuildupload = SELECT, INSERT, UPDATE, DELETE
281public.sourcepackagerecipedata = SELECT, INSERT, UPDATE, DELETE
282public.sourcepackagerecipedatainstruction = SELECT, INSERT, UPDATE, DELETE
278public.specificationbranch = SELECT, INSERT, UPDATE, DELETE283public.specificationbranch = SELECT, INSERT, UPDATE, DELETE
279public.specificationbug = SELECT, INSERT, DELETE284public.specificationbug = SELECT, INSERT, DELETE
280public.specificationdependency = SELECT, INSERT, DELETE285public.specificationdependency = SELECT, INSERT, DELETE
@@ -403,6 +408,8 @@
403public.shippingrun = SELECT408public.shippingrun = SELECT
404public.sprint = SELECT409public.sprint = SELECT
405public.sourcepackagereleasefile = SELECT410public.sourcepackagereleasefile = SELECT
411public.sourcepackagerecipebuild = SELECT
412public.sourcepackagerecipebuildupload = SELECT
406public.temporaryblobstorage = SELECT, DELETE413public.temporaryblobstorage = SELECT, DELETE
407public.translationimportqueueentry = SELECT414public.translationimportqueueentry = SELECT
408415
409416
=== modified file 'lib/lp/code/doc/branch.txt'
--- lib/lp/code/doc/branch.txt 2009-12-10 04:38:46 +0000
+++ lib/lp/code/doc/branch.txt 2010-01-13 05:13:16 +0000
@@ -601,6 +601,8 @@
601 productseries.branch601 productseries.branch
602 productseries.translations_branch602 productseries.translations_branch
603 seriessourcepackagebranch.branch603 seriessourcepackagebranch.branch
604 sourcepackagerecipedata.base_branch
605 sourcepackagerecipedatainstruction.branch
604 specificationbranch.branch606 specificationbranch.branch
605607
606(Unfortunately, references can form a cycle-- note that codereviewcomments608(Unfortunately, references can form a cycle-- note that codereviewcomments
607609
=== modified file 'lib/lp/code/model/branch.py'
--- lib/lp/code/model/branch.py 2009-12-11 00:56:16 +0000
+++ lib/lp/code/model/branch.py 2010-01-13 05:13:16 +0000
@@ -613,6 +613,7 @@
613 series_set = getUtility(IFindOfficialBranchLinks)613 series_set = getUtility(IFindOfficialBranchLinks)
614 alteration_operations.extend(614 alteration_operations.extend(
615 map(ClearOfficialPackageBranch, series_set.findForBranch(self)))615 map(ClearOfficialPackageBranch, series_set.findForBranch(self)))
616 # XXX MichaelHudson 2010-01-13: Handle sourcepackagerecipes here.
616 return (alteration_operations, deletion_operations)617 return (alteration_operations, deletion_operations)
617618
618 def deletionRequirements(self):619 def deletionRequirements(self):
619620
=== modified file 'lib/lp/registry/model/person.py'
--- lib/lp/registry/model/person.py 2010-01-07 06:27:46 +0000
+++ lib/lp/registry/model/person.py 2010-01-13 05:13:16 +0000
@@ -2838,6 +2838,8 @@
2838 (decorator_table.lower(), person_pointer_column.lower()))2838 (decorator_table.lower(), person_pointer_column.lower()))
28392839
2840 def _mergeBranches(self, cur, from_id, to_id):2840 def _mergeBranches(self, cur, from_id, to_id):
2841 # XXX MichaelHudson 2010-01-13 bug=506630: This code does not account
2842 # for package branches.
2841 cur.execute('''2843 cur.execute('''
2842 SELECT product, name FROM Branch WHERE owner = %(to_id)d2844 SELECT product, name FROM Branch WHERE owner = %(to_id)d
2843 ''' % vars())2845 ''' % vars())
@@ -3348,6 +3350,10 @@
3348 self._mergeBranches(cur, from_id, to_id)3350 self._mergeBranches(cur, from_id, to_id)
3349 skip.append(('branch','owner'))3351 skip.append(('branch','owner'))
33503352
3353 # XXX MichaelHudson 2010-01-13: Write _mergeSourcePackageRecipes!
3354 #self._mergeSourcePackageRecipes(cur, from_id, to_id))
3355 skip.append(('sourcepackagerecipe','owner'))
3356
3351 self._mergeMailingListSubscriptions(cur, from_id, to_id)3357 self._mergeMailingListSubscriptions(cur, from_id, to_id)
3352 skip.append(('mailinglistsubscription', 'person'))3358 skip.append(('mailinglistsubscription', 'person'))
33533359

Subscribers

People subscribed via source and target branches

to status/vote changes: