← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~twom/launchpad:db-oci-policy-push-tags-to-the-limit into launchpad:db-devel

 

Tom Wardill has proposed merging ~twom/launchpad:db-oci-policy-push-tags-to-the-limit into launchpad:db-devel.

Commit message:
DB patch for OCIImageTag

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~twom/launchpad/+git/launchpad/+merge/394958
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~twom/launchpad:db-oci-policy-push-tags-to-the-limit into launchpad:db-devel.
diff --git a/database/schema/patch-2210-24-0.sql b/database/schema/patch-2210-24-0.sql
new file mode 100644
index 0000000..223dd19
--- /dev/null
+++ b/database/schema/patch-2210-24-0.sql
@@ -0,0 +1,18 @@
+-- Copyright 2020 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 TABLE OCIImageTag (
+    id serial PRIMARY KEY,
+    tag text NOT NULL,
+    push_rule INTEGER NOT NULL REFERENCES OCIPushRule
+);
+
+CREATE INDEX ociimagetag__pushrule__idx ON OCIImageTag(push_rule);
+
+COMMENT ON TABLE OCIImageTag IS 'Registry tags for OCI Images.';
+COMMENT ON COLUMN OCIImageTag.tag IS 'The tag to apply to an image on upload.';
+COMMENT ON COLUMN OCIImageTag.push_rule IS 'The Push Rule that uses this tag.';
+
+INSERT INTO LaunchpadDatabaseRevision VALUES (2210, 24, 0);