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
1=== modified file 'database/schema/comments.sql'
2--- database/schema/comments.sql 2010-01-11 04:46:04 +0000
3+++ database/schema/comments.sql 2010-01-13 05:13:16 +0000
4@@ -1288,7 +1288,69 @@
5
6 COMMENT ON TABLE SourcePackageName IS 'SourcePackageName: A soyuz source package name.';
7
8+-- SourcePackageRecipeData
9+
10+COMMENT 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.';
11+COMMENT ON COLUMN SourcePackageRecipeData.base_branch IS 'The branch the recipe is based on.';
12+COMMENT ON COLUMN SourcePackageRecipeData.recipe_format IS 'The format version of the recipe.';
13+COMMENT ON COLUMN SourcePackageRecipeData.deb_version_template IS 'The template for the revision number of the build.';
14+COMMENT ON COLUMN SourcePackageRecipeData.revspec IS 'The revision from base_branch to use.';
15+COMMENT ON COLUMN SourcePackageRecipeData.sourcepackage_recipe IS 'The recipe that this data is for.';
16+COMMENT ON COLUMN SourcePackageRecipeData.sourcepackage_recipe_build IS 'The build that resulted in this manifest.';
17+
18+-- SourcePackageRecipeDataInstruction
19+
20+COMMENT ON TABLE SourcePackageRecipeDataInstruction IS 'A line from the recipe, specifying a branch to nest or merge.';
21+COMMENT ON COLUMN SourcePackageRecipeDataInstruction.name IS 'The name of the instruction.';
22+COMMENT ON COLUMN SourcePackageRecipeDataInstruction.type IS 'The type of the instruction (MERGE == 1, NEST == 2).';
23+COMMENT ON COLUMN SourcePackageRecipeDataInstruction.comment IS 'The comment from the recipe about this instruction.';
24+COMMENT ON COLUMN SourcePackageRecipeDataInstruction.line_number IS 'The line number of the instruction in the recipe.';
25+COMMENT ON COLUMN SourcePackageRecipeDataInstruction.branch IS 'The branch being merged or nested.';
26+COMMENT ON COLUMN SourcePackageRecipeDataInstruction.revspec IS 'The revision of the branch to use.';
27+COMMENT ON COLUMN SourcePackageRecipeDataInstruction.directory IS 'The location to nest at, if this is a nest instruction.';
28+COMMENT ON COLUMN SourcePackageRecipeDataInstruction.recipe_data IS 'The SourcePackageRecipeData this instruction is part of.';
29+COMMENT ON COLUMN SourcePackageRecipeDataInstruction.parent_instruction IS 'The nested branch this instruction applies to, or NULL for a top-level instruction.';
30+
31+-- SourcePackageRecipe
32+
33+COMMENT ON TABLE SourcePackageRecipe IS 'A recipe for assembling a source package from branches.';
34+COMMENT ON COLUMN SourcePackageRecipe.registrant IS 'The person who created this recipe.';
35+COMMENT ON COLUMN SourcePackageRecipe.owner IS 'The person or team who can edit this recipe.';
36+COMMENT ON COLUMN SourcePackageRecipe.distroseries IS 'The distroseries this recipe builds a package for.';
37+COMMENT ON COLUMN SourcePackageRecipe.sourcepackagename IS 'The name of the source package this recipe builds.';
38+COMMENT ON COLUMN SourcePackageRecipe.name IS 'The name of the recipe in the web/URL.';
39+
40+-- SourcePackageRecipeBuild
41+
42+COMMENT ON TABLE SourcePackageRecipeBuild IS 'The build record for the process of building a source package as described by a recipe.';
43+COMMENT ON COLUMN SourcePackageRecipeBuild.distroseries IS 'The distroseries the build was for.';
44+COMMENT ON COLUMN SourcePackageRecipeBuild.sourcepackagename IS 'The name of the source package that was built.';
45+COMMENT ON COLUMN SourcePackageRecipeBuild.build_state IS 'The state of the build.';
46+COMMENT ON COLUMN SourcePackageRecipeBuild.date_built IS 'When the build record was processed.';
47+COMMENT ON COLUMN SourcePackageRecipeBuild.build_duration IS 'How long this build took to be processed.';
48+COMMENT ON COLUMN SourcePackageRecipeBuild.build_log IS 'Points to the build_log file stored in librarian.';
49+COMMENT ON COLUMN SourcePackageRecipeBuild.builder IS 'Points to the builder which has once processed it.';
50+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.';
51+COMMENT ON COLUMN SourcePackageRecipeBuild.requester IS 'Who requested the build.';
52+COMMENT ON COLUMN SourcePackageRecipeBuild.recipe IS 'The recipe being processed.';
53+COMMENT ON COLUMN SourcePackageRecipeBuild.archive IS 'The archive the source package will be uploaded to.';
54+
55+-- SourcePackageRecipeBuildUpload
56+
57+COMMENT ON TABLE SourcePackageRecipeBuildUpload IS 'The record of uploading the source package built by a SourcePackageRecipeBuild to an archive.';
58+COMMENT ON COLUMN SourcePackageRecipeBuildUpload.registrant IS 'Who requested the upload.';
59+COMMENT ON COLUMN SourcePackageRecipeBuildUpload.sourcepackage_recipe_build IS 'Upload the output of this build.';
60+COMMENT ON COLUMN SourcePackageRecipeBuildUpload.archive IS 'The archive to upload to.';
61+COMMENT ON COLUMN SourcePackageRecipeBuildUpload.upload_log IS 'The output from uploading the source package to the archive.';
62+COMMENT ON COLUMN SourcePackageRecipeBuildUpload.state IS 'The state of the upload.';
63+
64+-- SourcePackageRecipeBuildJob
65+
66+COMMENT ON TABLE SourcePackageRecipeBuildJob IS 'The link between a SourcePackageRecipeBuild row and a Job row to schedule a build of a source package recipe.';
67+COMMENT ON COLUMN SourcePackageRecipeBuildJob.sourcepackage_recipe_build IS 'The build record describing the package being built.';
68+
69 -- Specification
70+
71 COMMENT 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.';
72 COMMENT ON COLUMN Specification.assignee IS 'The person who has been assigned to implement this specification.';
73 COMMENT 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.';
74
75=== added file 'database/schema/patch-2207-25-0.sql'
76--- database/schema/patch-2207-25-0.sql 1970-01-01 00:00:00 +0000
77+++ database/schema/patch-2207-25-0.sql 2010-01-13 05:13:16 +0000
78@@ -0,0 +1,149 @@
79+SET client_min_messages=ERROR;
80+
81+CREATE TABLE SourcePackageRecipe (
82+ id serial PRIMARY KEY,
83+ date_created timestamp without time zone DEFAULT timezone('UTC'::text, now()) NOT NULL,
84+ date_last_modified timestamp without time zone DEFAULT timezone('UTC'::text, now()) NOT NULL,
85+ registrant integer NOT NULL REFERENCES Person,
86+ owner integer NOT NULL REFERENCES Person,
87+ distroseries integer NOT NULL REFERENCES DistroSeries,
88+ sourcepackagename integer NOT NULL REFERENCES SourcePackageName,
89+ name text NOT NULL
90+);
91+
92+ALTER TABLE SourcePackageRecipe ADD CONSTRAINT sourcepackagerecipe__owner__distroseries__sourcepackagename__name__key
93+ UNIQUE (owner, distroseries, sourcepackagename, name);
94+
95+CREATE TABLE SourcePackageRecipeBuild (
96+ id serial PRIMARY KEY,
97+ -- most of this is just copied from Build
98+
99+ -- I've dropped: processor, sourcepackagerelease, pocket, dependencies
100+ -- changed: distroarchseries to distroseries
101+ -- added: recipe and manifest
102+ date_created timestamp without time zone DEFAULT timezone('UTC'::text, ('now'::text)::timestamp(6) with time zone) NOT NULL,
103+ distroseries integer NOT NULL REFERENCES distroseries,
104+ sourcepackagename integer NOT NULL REFERENCES SourcePackageName,
105+ build_state integer NOT NULL,
106+ date_built timestamp without time zone,
107+ build_duration interval,
108+ build_log integer REFERENCES libraryfilealias,
109+ builder integer REFERENCES builder,
110+ date_first_dispatched timestamp without time zone,
111+ requester integer NOT NULL REFERENCES Person,
112+ recipe integer REFERENCES SourcePackageRecipe NOT NULL,
113+ archive integer NOT NULL REFERENCES Archive
114+);
115+
116+CREATE TABLE SourcePackageRecipeBuildUpload (
117+ id serial PRIMARY KEY,
118+ date_created timestamp without time zone DEFAULT timezone('UTC'::text, ('now'::text)::timestamp(6) with time zone) NOT NULL,
119+ registrant integer NOT NULL REFERENCES Person,
120+ sourcepackage_recipe_build integer NOT NULL REFERENCES SourcePackageRecipeBuild,
121+ archive integer NOT NULL REFERENCES Archive,
122+ upload_log integer REFERENCES LibraryFileAlias,
123+ state integer NOT NULL -- an enum, WAITING/UPLOADED/FAILED or something like that.
124+);
125+
126+-- indexes for SourcePackageRecipeBuildUpload I guess
127+
128+ALTER TABLE SourcePackageRelease
129+ ADD COLUMN sourcepackage_recipe_build integer REFERENCES SourcePackageRecipeBuild;
130+
131+CREATE TABLE SourcePackageRecipeBuildJob (
132+ id serial PRIMARY KEY,
133+ job integer NOT NULL REFERENCES Job,
134+ sourcepackage_recipe_build integer REFERENCES SourcePackageRecipeBuild
135+);
136+
137+ALTER TABLE SourcePackageRecipeBuildJob ADD CONSTRAINT sourcepackagerecipebuildjob__sourcepackage_recipe_build__key
138+ UNIQUE (sourcepackage_recipe_build);
139+
140+ALTER TABLE SourcePackageRecipeBuildJob ADD CONSTRAINT sourcepackagerecipebuildjob__job__key
141+ UNIQUE (job);
142+
143+CREATE TABLE SourcePackageRecipeData (
144+ id serial PRIMARY KEY,
145+ base_branch integer NOT NULL REFERENCES Branch,
146+ recipe_format text NOT NULL,
147+ deb_version_template text NOT NULL,
148+ revspec text,
149+ sourcepackage_recipe integer REFERENCES SourcePackageRecipe,
150+ sourcepackage_recipe_build integer REFERENCES SourcePackageRecipeBuild
151+);
152+
153+ALTER TABLE SourcePackageRecipeData ADD CONSTRAINT sourcepackagerecipedata__recipe_or_build_is_not_null
154+ CHECK (sourcepackage_recipe IS NULL != sourcepackage_recipe_build IS NULL);
155+CREATE UNIQUE INDEX sourcepackagerecipedata__sourcepackage_recipe__key
156+ ON SourcepackageRecipeData(sourcepackage_recipe)
157+ WHERE sourcepackage_recipe IS NOT NULL;
158+CREATE UNIQUE INDEX sourcepackagerecipedata__sourcepackage_recipe_build__key
159+ ON SourcepackageRecipeData(sourcepackage_recipe_build)
160+ WHERE sourcepackage_recipe_build IS NOT NULL;
161+
162+CREATE TABLE SourcePackageRecipeDataInstruction (
163+ id serial PRIMARY KEY,
164+ name text NOT NULL,
165+ type integer NOT NULL, -- MERGE == 1, NEST == 2
166+ comment text,
167+ line_number integer NOT NULL,
168+ branch integer NOT NULL REFERENCES Branch,
169+ revspec text,
170+ directory text,
171+ recipe_data integer NOT NULL REFERENCES SourcePackageRecipeData,
172+ parent_instruction integer REFERENCES SourcePackageRecipeDataInstruction
173+);
174+
175+ALTER TABLE SourcePackageRecipeDataInstruction ADD CONSTRAINT sourcepackagerecipedatainstruction__name__recipe_data__key
176+ UNIQUE (name, recipe_data);
177+ALTER TABLE SourcePackageRecipeDataInstruction ADD CONSTRAINT sourcepackagerecipedatainstruction__recipe_data__line_number__key
178+ UNIQUE (recipe_data, line_number);
179+ALTER TABLE SourcePackageRecipeDataInstruction ADD CONSTRAINT sourcepackagerecipedatainstruction__directory_not_null
180+ CHECK ((type = 1 AND directory IS NULL) OR (type = 2 AND directory IS NOT NULL));
181+
182+CREATE INDEX sourcepackagerecipedata__base_branch__idx
183+ON SourcepackageRecipeData(base_branch);
184+
185+CREATE INDEX sourcepackagerecipedatainstruction__branch__idx
186+ON SourcepackageRecipeDataInstruction(branch);
187+
188+CREATE INDEX sourcepackagerecipe__registrant__idx
189+ON SourcepackageRecipe(registrant);
190+
191+--CREATE INDEX sourcepackagerecipe__owner__idx
192+--ON SourcepackageRecipe(owner);
193+
194+CREATE INDEX sourcepackagerecipebuild__distroseries__idx
195+ON SourcepackageRecipeBuild(distroseries);
196+
197+CREATE INDEX sourcepackagerecipebuild__sourcepackagename__idx
198+ON SourcepackageRecipeBuild(sourcepackagename);
199+
200+CREATE INDEX sourcepackagerecipebuild__build_log__idx
201+ON SourcepackageRecipeBuild(build_log) WHERE build_log IS NOT NULL;
202+
203+CREATE INDEX sourcepackagerecipebuild__builder__idx
204+ON SourcepackageRecipeBuild(builder);
205+
206+CREATE INDEX sourcepackagerecipebuild__requester__idx
207+ON SourcepackageRecipeBuild(requester);
208+
209+CREATE INDEX sourcepackagerecipebuild__recipe__idx
210+ON SourcepackageRecipeBuild(recipe);
211+
212+CREATE INDEX sourcepackagerecipebuild__archive__idx
213+ON SourcepackageRecipeBuild(archive);
214+
215+CREATE INDEX sourcepackagebuildupload__registrant__idx
216+ON SourcepackageRecipeBuildUpload(registrant);
217+
218+CREATE INDEX sourcepackagerecipebuildupload__archive__idx
219+ON SourcepackageRecipeBuildUpload(archive);
220+
221+CREATE INDEX sourcepackagerecipebuildupload__upload_log__idx
222+ON SourcepackageRecipeBuildUpload(upload_log) WHERE upload_log IS NOT NULL;
223+
224+CREATE INDEX sourcepackagerelease__sourcepackage_recipe_build__idx
225+ON SourcepackageRelease(sourcepackage_recipe_build);
226+
227+INSERT INTO LaunchpadDatabaseRevision VALUES (2207, 25, 0);
228
229=== modified file 'database/schema/security.cfg'
230--- database/schema/security.cfg 2010-01-06 14:25:01 +0000
231+++ database/schema/security.cfg 2010-01-13 05:13:16 +0000
232@@ -275,6 +275,11 @@
233 public.sourcepackagepublishinghistory = SELECT
234 public.seriessourcepackagebranch = SELECT, INSERT, UPDATE, DELETE
235 public.sourcepackageformatselection = SELECT
236+public.sourcepackagerecipe = SELECT, INSERT, UPDATE, DELETE
237+public.sourcepackagerecipebuild = SELECT, INSERT, UPDATE, DELETE
238+public.sourcepackagerecipebuildupload = SELECT, INSERT, UPDATE, DELETE
239+public.sourcepackagerecipedata = SELECT, INSERT, UPDATE, DELETE
240+public.sourcepackagerecipedatainstruction = SELECT, INSERT, UPDATE, DELETE
241 public.specificationbranch = SELECT, INSERT, UPDATE, DELETE
242 public.specificationbug = SELECT, INSERT, DELETE
243 public.specificationdependency = SELECT, INSERT, DELETE
244@@ -403,6 +408,8 @@
245 public.shippingrun = SELECT
246 public.sprint = SELECT
247 public.sourcepackagereleasefile = SELECT
248+public.sourcepackagerecipebuild = SELECT
249+public.sourcepackagerecipebuildupload = SELECT
250 public.temporaryblobstorage = SELECT, DELETE
251 public.translationimportqueueentry = SELECT
252
253
254=== modified file 'lib/lp/code/doc/branch.txt'
255--- lib/lp/code/doc/branch.txt 2009-12-10 04:38:46 +0000
256+++ lib/lp/code/doc/branch.txt 2010-01-13 05:13:16 +0000
257@@ -601,6 +601,8 @@
258 productseries.branch
259 productseries.translations_branch
260 seriessourcepackagebranch.branch
261+ sourcepackagerecipedata.base_branch
262+ sourcepackagerecipedatainstruction.branch
263 specificationbranch.branch
264
265 (Unfortunately, references can form a cycle-- note that codereviewcomments
266
267=== modified file 'lib/lp/code/model/branch.py'
268--- lib/lp/code/model/branch.py 2009-12-11 00:56:16 +0000
269+++ lib/lp/code/model/branch.py 2010-01-13 05:13:16 +0000
270@@ -613,6 +613,7 @@
271 series_set = getUtility(IFindOfficialBranchLinks)
272 alteration_operations.extend(
273 map(ClearOfficialPackageBranch, series_set.findForBranch(self)))
274+ # XXX MichaelHudson 2010-01-13: Handle sourcepackagerecipes here.
275 return (alteration_operations, deletion_operations)
276
277 def deletionRequirements(self):
278
279=== modified file 'lib/lp/registry/model/person.py'
280--- lib/lp/registry/model/person.py 2010-01-07 06:27:46 +0000
281+++ lib/lp/registry/model/person.py 2010-01-13 05:13:16 +0000
282@@ -2838,6 +2838,8 @@
283 (decorator_table.lower(), person_pointer_column.lower()))
284
285 def _mergeBranches(self, cur, from_id, to_id):
286+ # XXX MichaelHudson 2010-01-13 bug=506630: This code does not account
287+ # for package branches.
288 cur.execute('''
289 SELECT product, name FROM Branch WHERE owner = %(to_id)d
290 ''' % vars())
291@@ -3348,6 +3350,10 @@
292 self._mergeBranches(cur, from_id, to_id)
293 skip.append(('branch','owner'))
294
295+ # XXX MichaelHudson 2010-01-13: Write _mergeSourcePackageRecipes!
296+ #self._mergeSourcePackageRecipes(cur, from_id, to_id))
297+ skip.append(('sourcepackagerecipe','owner'))
298+
299 self._mergeMailingListSubscriptions(cur, from_id, to_id)
300 skip.append(('mailinglistsubscription', 'person'))
301

Subscribers

People subscribed via source and target branches

to status/vote changes: