← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~lgp171188/launchpad:security-tracker-cve-table-changes into launchpad:db-devel

 

Guruprasad has proposed merging ~lgp171188/launchpad:security-tracker-cve-table-changes into launchpad:db-devel.

Commit message:
Add the date_made_public, discoverer, cvss columns to Cve

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~lgp171188/launchpad/+git/launchpad/+merge/415905
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~lgp171188/launchpad:security-tracker-cve-table-changes into launchpad:db-devel.
diff --git a/database/schema/patch-2210-43-0.sql b/database/schema/patch-2210-43-0.sql
new file mode 100644
index 0000000..fd48955
--- /dev/null
+++ b/database/schema/patch-2210-43-0.sql
@@ -0,0 +1,21 @@
+-- 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 Cve
+    ADD COLUMN date_made_public timestamp without time zone,
+    ADD COLUMN discoverer INTEGER,
+    ADD CONSTRAINT cve__discoverer__fkey
+        FOREIGN KEY (discoverer) REFERENCES Person,
+    ADD COLUMN cvss jsonb;
+
+COMMENT ON COLUMN Cve.date_made_public IS 'The date on which the CVE was made public.';
+
+COMMENT ON COLUMN Cve.discoverer IS 'The person who discovered this CVE.';
+
+COMMENT ON COLUMN Cve.cvss IS 'The CVSS score for this CVE.';
+
+CREATE INDEX cve__discoverer__idx ON Cve (discoverer);
+
+INSERT INTO LaunchpadDatabaseRevision VALUES (2210, 43, 0);