← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~alvarocs/launchpad:add-recipe-platform-column-db into launchpad:db-devel

 

Alvaro Crespo Serrano has proposed merging ~alvarocs/launchpad:add-recipe-platform-column-db into launchpad:db-devel.

Commit message:
Add 'recipe_platform_name' column to CharmRecipeBuild, RockRecipeBuild, SnapBuild and SourcePackageRecipeBuild tables.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~alvarocs/launchpad/+git/launchpad/+merge/482915

With the adoption of craft-platforms multi-base approach, Launchpad must handle scenarios where a single recipe can define multiple “platforms” (each potentially targeting a different base or configuration). To accommodate this, we need to store the specific platform name used when building an artifact to pass it to the builder.

Commit to dbpatches to allocate patch id: https://git.launchpad.net/~launchpad/+git/dbpatches/commit/?id=1d4ee380bf8671507d11af0faed0434c1096b489 
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~alvarocs/launchpad:add-recipe-platform-column-db into launchpad:db-devel.
diff --git a/database/schema/patch-2211-33-0.sql b/database/schema/patch-2211-33-0.sql
new file mode 100644
index 0000000..28b7643
--- /dev/null
+++ b/database/schema/patch-2211-33-0.sql
@@ -0,0 +1,16 @@
+-- Copyright 2025 Canonical Ltd.  This software is licensed under the
+-- GNU Affero General Public License version 3 (see the file LICENSE).
+
+SET client_min_messages=ERROR;
+
+ALTER TABLE CharmRecipeBuild ADD COLUMN recipe_platform_name text;
+ALTER TABLE RockRecipeBuild ADD COLUMN recipe_platform_name text;
+ALTER TABLE SnapBuild ADD COLUMN recipe_platform_name text;
+ALTER TABLE SourcePackageRecipeBuild ADD COLUMN recipe_platform_name text;
+
+COMMENT ON COLUMN CharmRecipeBuild.recipe_platform_name IS 'The platform name from the craft recipe for which the Charm artifact is built.';
+COMMENT ON COLUMN RockRecipeBuild.recipe_platform_name IS 'The platform name from the craft recipe for which the Rock artifact is built.'; 
+COMMENT ON COLUMN SnapBuild.recipe_platform_name IS 'The platform name from the craft recipe for which the Snap artifact is built.';
+COMMENT ON COLUMN SourcePackageRecipeBuild.recipe_platform_name IS 'The platform name from the craft recipe for which the Source artifact is built.';
+
+INSERT INTO LaunchpadDatabaseRevision VALUES (2211, 33, 0);