← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~abentley/launchpad/incremental-db into lp:launchpad

 

Aaron Bentley has proposed merging lp:~abentley/launchpad/incremental-db into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)


= Summary =
This patch adds incremental diffs to the DB schema so that we can display them
for code review.

== Proposed fix ==
See above

== Pre-implementation notes ==

== Implementation details ==
The diffs will generally be accessed by (branch_merge_proposal, old_revision,
new_revision integer).  These could be specified as unique values.

Should we make them an index?  Should we make them a composite key?

== Tests ==
None

== Demo and Q/A ==
None


= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  database/schema/patch-2208-99-0.sql
  database/sampledata/current.sql
  database/sampledata/current-dev.sql
  database/schema/security.cfg

./database/schema/patch-2208-99-0.sql
       8: Line exceeds 78 characters.
       9: Line exceeds 78 characters.
      10: Line exceeds 78 characters.
      11: Line exceeds 78 characters.
./database/schema/security.cfg
     680: Line exceeds 78 characters.
     681: Line exceeds 78 characters.
     682: Line exceeds 78 characters.
     706: Line exceeds 78 characters.
     710: Line exceeds 78 characters.
     765: Line exceeds 78 characters.
     778: Line exceeds 78 characters.
     779: Line exceeds 78 characters.
     796: Line exceeds 78 characters.
     797: Line exceeds 78 characters.
     798: Line exceeds 78 characters.
     799: Line exceeds 78 characters.
     800: Line exceeds 78 characters.
     847: Line exceeds 78 characters.
     848: Line exceeds 78 characters.
     849: Line exceeds 78 characters.
     879: Line exceeds 78 characters.
-- 
https://code.launchpad.net/~abentley/launchpad/incremental-db/+merge/36490
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~abentley/launchpad/incremental-db into lp:launchpad.
=== modified file 'database/sampledata/current-dev.sql'
--- database/sampledata/current-dev.sql	2010-09-20 23:40:08 +0000
+++ database/sampledata/current-dev.sql	2010-09-23 19:19:21 +0000
@@ -813,6 +813,15 @@
 
 
 
+
+
+
+
+
+
+
+
+
 SET SESSION AUTHORIZATION DEFAULT;
 
 ALTER TABLE account DISABLE TRIGGER ALL;
@@ -3841,6 +3850,27 @@
 ALTER TABLE bugtrackeralias ENABLE TRIGGER ALL;
 
 
+ALTER TABLE bugtrackercomponentgroup DISABLE TRIGGER ALL;
+
+
+
+ALTER TABLE bugtrackercomponentgroup ENABLE TRIGGER ALL;
+
+
+ALTER TABLE distributionsourcepackage DISABLE TRIGGER ALL;
+
+
+
+ALTER TABLE distributionsourcepackage ENABLE TRIGGER ALL;
+
+
+ALTER TABLE bugtrackercomponent DISABLE TRIGGER ALL;
+
+
+
+ALTER TABLE bugtrackercomponent ENABLE TRIGGER ALL;
+
+
 ALTER TABLE bugtrackerperson DISABLE TRIGGER ALL;
 
 
@@ -4066,13 +4096,6 @@
 ALTER TABLE distributionmirror ENABLE TRIGGER ALL;
 
 
-ALTER TABLE distributionsourcepackage DISABLE TRIGGER ALL;
-
-
-
-ALTER TABLE distributionsourcepackage ENABLE TRIGGER ALL;
-
-
 ALTER TABLE distributionsourcepackagecache DISABLE TRIGGER ALL;
 
 INSERT INTO distributionsourcepackagecache (id, distribution, sourcepackagename, name, binpkgnames, binpkgsummaries, binpkgdescriptions, fti, changelog, archive) VALUES (1, 3, 19, 'alsa-utils', '', '', '', NULL, NULL, 1);
@@ -4639,6 +4662,13 @@
 ALTER TABLE hwtestanswerdevice ENABLE TRIGGER ALL;
 
 
+ALTER TABLE incrementaldiff DISABLE TRIGGER ALL;
+
+
+
+ALTER TABLE incrementaldiff ENABLE TRIGGER ALL;
+
+
 ALTER TABLE ircid DISABLE TRIGGER ALL;
 
 INSERT INTO ircid (id, person, network, nickname) VALUES (1, 1, 'irc.freenode.net', 'mark');

=== modified file 'database/sampledata/current.sql'
--- database/sampledata/current.sql	2010-09-20 23:40:08 +0000
+++ database/sampledata/current.sql	2010-09-23 19:19:21 +0000
@@ -813,6 +813,15 @@
 
 
 
+
+
+
+
+
+
+
+
+
 SET SESSION AUTHORIZATION DEFAULT;
 
 ALTER TABLE account DISABLE TRIGGER ALL;
@@ -3795,6 +3804,27 @@
 ALTER TABLE bugtrackeralias ENABLE TRIGGER ALL;
 
 
+ALTER TABLE bugtrackercomponentgroup DISABLE TRIGGER ALL;
+
+
+
+ALTER TABLE bugtrackercomponentgroup ENABLE TRIGGER ALL;
+
+
+ALTER TABLE distributionsourcepackage DISABLE TRIGGER ALL;
+
+
+
+ALTER TABLE distributionsourcepackage ENABLE TRIGGER ALL;
+
+
+ALTER TABLE bugtrackercomponent DISABLE TRIGGER ALL;
+
+
+
+ALTER TABLE bugtrackercomponent ENABLE TRIGGER ALL;
+
+
 ALTER TABLE bugtrackerperson DISABLE TRIGGER ALL;
 
 
@@ -4020,13 +4050,6 @@
 ALTER TABLE distributionmirror ENABLE TRIGGER ALL;
 
 
-ALTER TABLE distributionsourcepackage DISABLE TRIGGER ALL;
-
-
-
-ALTER TABLE distributionsourcepackage ENABLE TRIGGER ALL;
-
-
 ALTER TABLE distributionsourcepackagecache DISABLE TRIGGER ALL;
 
 INSERT INTO distributionsourcepackagecache (id, distribution, sourcepackagename, name, binpkgnames, binpkgsummaries, binpkgdescriptions, fti, changelog, archive) VALUES (1, 3, 19, 'alsa-utils', '', '', '', NULL, NULL, 1);
@@ -4577,6 +4600,13 @@
 ALTER TABLE hwtestanswerdevice ENABLE TRIGGER ALL;
 
 
+ALTER TABLE incrementaldiff DISABLE TRIGGER ALL;
+
+
+
+ALTER TABLE incrementaldiff ENABLE TRIGGER ALL;
+
+
 ALTER TABLE ircid DISABLE TRIGGER ALL;
 
 INSERT INTO ircid (id, person, network, nickname) VALUES (1, 1, 'irc.freenode.net', 'mark');

=== added file 'database/schema/patch-2208-99-0.sql'
--- database/schema/patch-2208-99-0.sql	1970-01-01 00:00:00 +0000
+++ database/schema/patch-2208-99-0.sql	2010-09-23 19:19:21 +0000
@@ -0,0 +1,13 @@
+-- Copyright 2010 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 IncrementalDiff(
+    id serial PRIMARY KEY,
+    diff integer NOT NULL CONSTRAINT diff_fk REFERENCES Diff ON DELETE CASCADE,
+    branch_merge_proposal integer NOT NULL CONSTRAINT branch_merge_proposal_fk REFERENCES BranchMergeProposal ON DELETE CASCADE,
+    old_revision integer NOT NULL CONSTRAINT old_revision_fk REFERENCES Revision ON DELETE CASCADE,
+    new_revision integer NOT NULL CONSTRAINT new_revision_fk REFERENCES Revision ON DELETE CASCADE);
+
+INSERT INTO LaunchpadDatabaseRevision VALUES (2208, 99, 0);

=== modified file 'database/schema/security.cfg'
--- database/schema/security.cfg	2010-09-23 11:37:58 +0000
+++ database/schema/security.cfg	2010-09-23 19:19:21 +0000
@@ -170,6 +170,7 @@
 public.hwtest                           = SELECT
 public.hwvendorid                       = SELECT
 public.hwvendorname                     = SELECT
+public.incrementaldiff                  = SELECT, INSERT, UPDATE, DELETE
 public.job                              = SELECT, INSERT, UPDATE, DELETE
 public.karmacache                       = SELECT
 public.karmacategory                    = SELECT
@@ -596,6 +597,7 @@
 public.distribution                     = SELECT
 public.distributionsourcepackage        = SELECT, UPDATE
 public.emailaddress                     = SELECT
+public.incrementaldiff                  = SELECT
 public.job                              = SELECT, INSERT, UPDATE, DELETE
 # Karma
 public.karma                            = SELECT, INSERT