← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~lgp171188/launchpad:merge-db-stable into launchpad:master

 

Guruprasad has proposed merging ~lgp171188/launchpad:merge-db-stable into launchpad:master.

Commit message:
Merge db-stable fba0a66df2 (Add RockRecipe.git_repository_url)

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~lgp171188/launchpad/+git/launchpad/+merge/474499
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~lgp171188/launchpad:merge-db-stable into launchpad:master.
diff --git a/database/schema/patch-2211-28-3.sql b/database/schema/patch-2211-28-3.sql
new file mode 100644
index 0000000..04c277e
--- /dev/null
+++ b/database/schema/patch-2211-28-3.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 RockRecipe
+    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 RockRecipe.git_repository_url IS 'A URL to a Git repository with a branch containing a rock recipe.';
+
+INSERT INTO LaunchpadDatabaseRevision VALUES (2211, 28, 3);