← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Alvaro Crespo Serrano has proposed merging ~alvarocs/launchpad:merge-db-stable into launchpad:master.

Commit message:
Merge db-stable ad5f58bbac63 (4 DB patches)

* Add bugattachment.vulnerability_patches
* Add date_deferred column to bugtask
* Add bugpresence and sourcepackageseries table
* Drop craft_platform column from SourcePackageRecipeBuild and add it to CraftRecipeBuild

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~alvarocs/launchpad/+git/launchpad/+merge/485041
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~alvarocs/launchpad:merge-db-stable into launchpad:master.
diff --git a/database/schema/patch-2211-33-1.sql b/database/schema/patch-2211-33-1.sql
new file mode 100644
index 0000000..4c48850
--- /dev/null
+++ b/database/schema/patch-2211-33-1.sql
@@ -0,0 +1,11 @@
+-- Copyright 2025 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 SourcePackageRecipeBuild DROP COLUMN craft_platform;
+ALTER TABLE CraftRecipeBuild ADD COLUMN craft_platform text;
+
+COMMENT ON COLUMN CraftRecipeBuild.craft_platform IS 'The platform name from the Source recipe for which the Source artifact is built.';
+
+INSERT INTO LaunchpadDatabaseRevision VALUES (2211, 33, 1);
diff --git a/database/schema/patch-2211-35-0.sql b/database/schema/patch-2211-35-0.sql
new file mode 100644
index 0000000..807e748
--- /dev/null
+++ b/database/schema/patch-2211-35-0.sql
@@ -0,0 +1,72 @@
+-- Copyright 2025 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 bugpresence (
+    id serial PRIMARY KEY,
+    bug integer NOT NULL REFERENCES bug,
+    project integer REFERENCES project,
+    distribution integer REFERENCES distribution,
+    source_package_name integer REFERENCES sourcepackagename,
+    git_repository integer REFERENCES gitrepository,
+    break_fix_data JSONB
+);
+
+CREATE INDEX bugpresence__bug__idx ON bugpresence (bug);
+CREATE INDEX bugpresence__project__idx ON bugpresence (project);
+CREATE INDEX bugpresence__distribution__idx ON bugpresence (distribution);
+CREATE INDEX bugpresence__source_package_name__idx
+  ON bugpresence (source_package_name);
+CREATE INDEX bugpresence__git_repository__idx ON bugpresence (git_repository);
+
+COMMENT ON TABLE bugpresence IS 'Stores information about points in the code
+ history (like commit IDs and versions) of various entities like a project, a
+ distribution, or a distribution source package when something was broken
+ and/or when it was fixed.';
+COMMENT ON COLUMN bugpresence.bug IS 'The bug that this bug presence row is
+ related to.';
+COMMENT ON COLUMN bugpresence.project IS 'The project that this bug presence
+ row is related to.';
+COMMENT ON COLUMN bugpresence.distribution IS 'The distribution that this bug
+ presence row is related to.';
+COMMENT ON COLUMN bugpresence.source_package_name IS 'The source package name
+ that this bug presence row relates to.';
+COMMENT ON COLUMN bugpresence.git_repository IS 'The git repository that this
+ bug presence row is related to.';
+COMMENT ON COLUMN bugpresence.break_fix_data IS 'Information about the commits
+ that caused an issue (break) and the commits that fixed the issue (fix).';
+
+CREATE TABLE sourcepackageseries (
+    id serial PRIMARY KEY,
+    distroseries integer NOT NULL REFERENCES distroseries,
+    source_package_name integer NOT NULL REFERENCES sourcepackagename,
+    name TEXT NOT NULL,
+    status integer NOT NULL,
+    repositories JSONB,
+    CONSTRAINT valid_name CHECK (valid_name(name))
+);
+
+CREATE INDEX sourcepackageseries__distroseries__idx
+  ON sourcepackageseries (distroseries);
+CREATE INDEX sourcepackageseries__source_package_name__idx
+  ON sourcepackageseries (source_package_name);
+CREATE INDEX sourcepackageseries__name__idx
+  ON sourcepackageseries (name);
+CREATE INDEX sourcepackageseries__status__idx
+  ON sourcepackageseries (status);
+
+COMMENT ON TABLE sourcepackageseries IS 'The per-package series of a source
+ package in a distroseries.';
+COMMENT ON COLUMN sourcepackageseries.distroseries IS 'The distroseries of
+ this sourcepackageseries.';
+COMMENT ON COLUMN sourcepackageseries.source_package_name IS 'The
+ sourcepackagename of this sourcepackageseries.';
+COMMENT ON COLUMN sourcepackageseries.name IS 'The name of this
+ sourcepackageseries.';
+COMMENT ON COLUMN sourcepackageseries.status IS 'The status of this
+ sourcepackageseries.';
+COMMENT ON COLUMN sourcepackageseries.repositories IS 'Repositories related to
+ this sourcepackageseries.';
+
+INSERT INTO LaunchpadDatabaseRevision VALUES (2211, 35, 0);
diff --git a/database/schema/patch-2211-36-0.sql b/database/schema/patch-2211-36-0.sql
new file mode 100644
index 0000000..77c43f2
--- /dev/null
+++ b/database/schema/patch-2211-36-0.sql
@@ -0,0 +1,10 @@
+-- Copyright 2025 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 ADD COLUMN vulnerability_patches jsonb;
+COMMENT ON COLUMN bugattachment.vulnerability_patches
+    IS 'Information about the patches for the associated vulnerability.';
+
+INSERT INTO LaunchpadDatabaseRevision VALUES (2211, 36, 0);
diff --git a/database/schema/patch-2211-37-0.sql b/database/schema/patch-2211-37-0.sql
new file mode 100644
index 0000000..760578d
--- /dev/null
+++ b/database/schema/patch-2211-37-0.sql
@@ -0,0 +1,14 @@
+-- Copyright 2025 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 bugtask
+    ADD COLUMN date_deferred timestamp without time zone;
+
+COMMENT ON COLUMN bugtask.date_deferred
+    IS 'The date when this bug task transitioned to the DEFERRED status.';
+
+-- indexing bugtask.date_deferred in a hot patch
+
+INSERT INTO LaunchpadDatabaseRevision VALUES (2211, 37, 0);
diff --git a/database/schema/security.cfg b/database/schema/security.cfg
index 4aef3e5..e812fc4 100644
--- a/database/schema/security.cfg
+++ b/database/schema/security.cfg
@@ -149,6 +149,7 @@ public.bugnotification                  = SELECT, INSERT, UPDATE, DELETE
 public.bugnotificationattachment        = SELECT, INSERT
 public.bugnotificationfilter            = SELECT, INSERT, UPDATE, DELETE
 public.bugnotificationrecipient         = SELECT, INSERT, UPDATE, DELETE
+public.bugpresence                      = SELECT, INSERT, UPDATE, DELETE
 public.bugsummary                       = SELECT
 public.bugsummaryjournal                = SELECT
 public.bugsummary_rollup_journal(integer) = EXECUTE
@@ -346,6 +347,7 @@ public.sourcepackagerecipebuild         = SELECT, INSERT, UPDATE, DELETE
 public.sourcepackagerecipedata          = SELECT, INSERT, UPDATE, DELETE
 public.sourcepackagerecipedatainstruction = SELECT, INSERT, UPDATE, DELETE
 public.sourcepackagerecipedistroseries  = SELECT, INSERT, DELETE
+public.sourcepackageseries              = SELECT, INSERT, DELETE
 public.specification                    = SELECT, INSERT, UPDATE
 public.specificationbranch              = SELECT, INSERT, UPDATE, DELETE
 public.specificationdependency          = SELECT, INSERT, DELETE
@@ -3017,4 +3019,4 @@ public.product                          = SELECT
 public.teammembership                   = SELECT
 public.teamparticipation                = SELECT
 public.webhook                          = SELECT
-public.webhookjob                       = SELECT, INSERT
\ No newline at end of file
+public.webhookjob                       = SELECT, INSERT