Code review comment for lp:~abentley/launchpad/package-build-recipe

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

There are two flaws I can see in the DB patch.

Firstly, you create the NewPackageBuild temporary table but neglect to insert the new rows into the PackageBuild table. This needs to be done before the UPDATE SourcePackageRecipeBuild or it will fail, as it is attempting to link to nonexistant PackageBuild rows:

    INSERT INTO PackageBuild SELECT * FROM NewPackageBuild;

The second issue is SourcePackageRecipeBuild.package_build column is declared NOT NULL before it is populated, so will fail when that table actually contains data. Instead we need to add the new column without the NOT NULL clause, then populate it, and then add the NOT NULL clause after the UPDATE:

    ALTER TABLE SourcePackageRecipeBuild
        ALTER COLUMN package_build SET NOT NULL;

Otherwise it looks fine. patch-2207-75-0.sql

review: Approve (db)

« Back to merge proposal