← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~andrey-fedoseev/launchpad:db-bug-attachment-url into launchpad:db-devel

 

Andrey Fedoseev has proposed merging ~andrey-fedoseev/launchpad:db-bug-attachment-url into launchpad:db-devel.

Commit message:
Add `BugAttachment.url` field


Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~andrey-fedoseev/launchpad/+git/launchpad/+merge/431023

The `BugAttachment.libraryfile` is now optional

A BugAttachment can either contain a file, or an external URL
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~andrey-fedoseev/launchpad:db-bug-attachment-url into launchpad:db-devel.
diff --git a/database/schema/patch-2211-11-0.sql b/database/schema/patch-2211-11-0.sql
new file mode 100644
index 0000000..64c4a0e
--- /dev/null
+++ b/database/schema/patch-2211-11-0.sql
@@ -0,0 +1,13 @@
+-- Copyright 2022 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 BugAttachment
+    ALTER COLUMN libraryfile drop not null,
+    ADD COLUMN url text;
+
+COMMENT ON COLUMN BugAttachment.url
+    IS 'External URL of the attachment.';
+
+INSERT INTO LaunchpadDatabaseRevision VALUES (2211, 11, 0);