← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~ines-almeida/launchpad:db-snap-pro-enable-constraints into launchpad:db-devel

 

Ines Almeida has proposed merging ~ines-almeida/launchpad:db-snap-pro-enable-constraints into launchpad:db-devel.

Commit message:
db: add NOT NULL constraint to Snap.pro_enable column

Requested reviews:
  William Grant (wgrant): db
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~ines-almeida/launchpad/+git/launchpad/+merge/457147

This is the first part of the cleanup needed after the Snap.pro_enable migration which is now finished in production.

See https://warthogs.atlassian.net/browse/LP-1350
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~ines-almeida/launchpad:db-snap-pro-enable-constraints into launchpad:db-devel.
diff --git a/database/schema/patch-2211-24-0.sql b/database/schema/patch-2211-24-0.sql
new file mode 100644
index 0000000..3aafba3
--- /dev/null
+++ b/database/schema/patch-2211-24-0.sql
@@ -0,0 +1,9 @@
+-- Copyright 2023 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 Snap 
+    ALTER COLUMN pro_enable SET NOT NULL;
+
+INSERT INTO LaunchpadDatabaseRevision VALUES (2211, 24, 0);

Follow ups