Code review comment for lp:~mwhudson/launchpad/recipe-db-schema

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)

« Back to merge proposal