← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~pappacena/launchpad:snap-pillar-db-indexes into launchpad:db-devel

 

Thiago F. Pappacena has proposed merging ~pappacena/launchpad:snap-pillar-db-indexes into launchpad:db-devel with ~pappacena/launchpad:snap-pillar-db as a prerequisite.

Commit message:
Snap privacy indexes and CHECK constraint validation

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~pappacena/launchpad/+git/launchpad/+merge/398361
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~pappacena/launchpad:snap-pillar-db-indexes into launchpad:db-devel.
diff --git a/database/schema/patch-2210-26-2.sql b/database/schema/patch-2210-26-2.sql
new file mode 100644
index 0000000..ab6e0a3
--- /dev/null
+++ b/database/schema/patch-2210-26-2.sql
@@ -0,0 +1,14 @@
+-- Copyright 2021 Canonical Ltd.  This software is licensed under the
+-- GNU Affero General Public License version 3 (see the file LICENSE).
+
+SET client_min_messages=ERROR;
+
+CREATE INDEX snap__project__idx ON Snap(project) WHERE project IS NOT NULL;
+
+CREATE UNIQUE INDEX accessartifact__snap__key
+    ON AccessArtifact(snap) WHERE snap IS NOT NULL;
+
+ALTER TABLE AccessArtifact VALIDATE CONSTRAINT has_artifact;
+
+
+INSERT INTO LaunchpadDatabaseRevision VALUES (2210, 26, 2);

Follow ups