← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~ruinedyourlife/launchpad:add-git-respository-url-craft-recipe into launchpad:db-devel

 

Quentin Debhi has proposed merging ~ruinedyourlife/launchpad:add-git-respository-url-craft-recipe into launchpad:db-devel.

Commit message:
Add CraftRecipe.git_repository_url

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

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

This is required for building craft recipes from a remote git repository not hosted on Launchpad.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~ruinedyourlife/launchpad:add-git-respository-url-craft-recipe into launchpad:db-devel.
diff --git a/database/schema/patch-2211-29-2.sql b/database/schema/patch-2211-29-2.sql
new file mode 100644
index 0000000..ecdd64d
--- /dev/null
+++ b/database/schema/patch-2211-29-2.sql
@@ -0,0 +1,15 @@
+-- Copyright 2024 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 CraftRecipe
+    ADD COLUMN git_repository_url text,
+    DROP CONSTRAINT consistent_git_ref,
+    ADD CONSTRAINT consistent_git_ref CHECK (((git_repository IS NULL) AND (git_repository_url IS NULL)) = (git_path IS NULL)),
+    ADD CONSTRAINT consistent_vcs CHECK (null_count(ARRAY[git_repository, octet_length(git_repository_url)]) >= 1),
+    ADD CONSTRAINT valid_git_repository_url CHECK (valid_absolute_url(git_repository_url));
+
+COMMENT ON COLUMN CraftRecipe.git_repository_url IS 'A URL to a Git repository with a branch containing a craft recipe.';
+
+INSERT INTO LaunchpadDatabaseRevision VALUES (2211, 28, 3);