← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~danilo/launchpad/bug-814580-resubmit-db into lp:launchpad/db-devel

 

Данило Шеган has proposed merging lp:~danilo/launchpad/bug-814580-resubmit-db into lp:launchpad/db-devel.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #814580 in Launchpad itself: "Merge/split messages from all sharing templates"
  https://bugs.launchpad.net/launchpad/+bug/814580

For more details, see:
https://code.launchpad.net/~danilo/launchpad/bug-814580-resubmit-db/+merge/70259

= Bug 814580: DB patch resubmission =

This is a resubmitted DB patch from https://code.launchpad.net/~danilo/launchpad/bug-814580-db/+merge/69979

Sampledata has not been updated (so diff doesn't become too big to easily look at).

= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  database/schema/comments.sql
  database/schema/patch-2208-98-1.sql
-- 
https://code.launchpad.net/~danilo/launchpad/bug-814580-resubmit-db/+merge/70259
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~danilo/launchpad/bug-814580-resubmit-db into lp:launchpad/db-devel.
=== modified file 'database/schema/comments.sql'
--- database/schema/comments.sql	2011-07-14 16:50:13 +0000
+++ database/schema/comments.sql	2011-08-03 07:56:46 +0000
@@ -1901,6 +1901,7 @@
 COMMENT ON COLUMN PackagingJob.productseries IS 'The productseries of the Packaging.';
 COMMENT ON COLUMN PackagingJob.sourcepackagename IS 'The sourcepackage of the Packaging.';
 COMMENT ON COLUMN PackagingJob.distroseries IS 'The distroseries of the Packaging.';
+COMMENT ON COLUMN PackagingJob.potemplate IS 'A POTemplate to restrict the job to or NULL if all templates need to be handled.';
 
 -- Translator / TranslationGroup
 

=== added file 'database/schema/patch-2208-98-1.sql'
--- database/schema/patch-2208-98-1.sql	1970-01-01 00:00:00 +0000
+++ database/schema/patch-2208-98-1.sql	2011-08-03 07:56:46 +0000
@@ -0,0 +1,24 @@
+-- Copyright 2011 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 PackagingJob
+  ADD COLUMN
+    potemplate INTEGER DEFAULT NULL
+      CONSTRAINT potemplate_fk REFERENCES POTemplate;
+
+ALTER TABLE PackagingJob
+  ALTER COLUMN productseries DROP NOT NULL,
+  ALTER COLUMN distroseries DROP NOT NULL,
+  ALTER COLUMN sourcepackagename DROP NOT NULL,
+  ADD CONSTRAINT translationtemplatejob_valid_link CHECK (
+    -- If there is a template, it is the template being moved.
+    (potemplate IS NOT NULL AND productseries IS NULL AND
+     distroseries IS NULL AND sourcepackagename IS NULL) OR
+    -- If there is no template, we need all of productseries, distroseries
+    -- and sourcepackagename because we are moving translations between
+    -- a productseries and a source package.
+    (potemplate IS NULL AND productseries IS NOT NULL AND
+     distroseries IS NOT NULL AND sourcepackagename IS NOT NULL));
+
+INSERT INTO LaunchpadDatabaseRevision VALUES (2208, 98, 1);