launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #32537
[Merge] ~tushar5526/launchpad:add-git-repository-url-to-charm-recipes into launchpad:db-devel
Tushar Gupta has proposed merging ~tushar5526/launchpad:add-git-repository-url-to-charm-recipes into launchpad:db-devel.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~tushar5526/launchpad/+git/launchpad/+merge/486194
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~tushar5526/launchpad:add-git-repository-url-to-charm-recipes into launchpad:db-devel.
diff --git a/database/schema/patch-2211-41-0.sql b/database/schema/patch-2211-41-0.sql
new file mode 100644
index 0000000..abc7069
--- /dev/null
+++ b/database/schema/patch-2211-41-0.sql
@@ -0,0 +1,15 @@
+-- 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 CharmRecipe
+ 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 CharmRecipe.git_repository_url IS 'A URL to a Git repository with a branch containing a charm recipe.';
+
+INSERT INTO LaunchpadDatabaseRevision VALUES (2211, 41, 0);
References