Merge lp:~benji/launchpad/bug-877195-db-3 into lp:launchpad

Proposed by Benji York
Status: Rejected
Rejected by: Benji York
Proposed branch: lp:~benji/launchpad/bug-877195-db-3
Merge into: lp:launchpad
Diff against target: 108 lines (+47/-1)
6 files modified
database/replication/helpers.py (+10/-1)
database/schema/comments.sql (+3/-0)
database/schema/patch-2208-01-3.sql (+17/-0)
database/schema/patch-2208-93-2.sql (+13/-0)
database/schema/security.cfg (+3/-0)
lib/lp/code/doc/branch.txt (+1/-0)
To merge this branch: bzr merge lp:~benji/launchpad/bug-877195-db-3
Reviewer Review Type Date Requested Status
Robert Collins Pending
Stuart Bishop Pending
Launchpad code reviewers Pending
Review via email: mp+83623@code.launchpad.net

This proposal supersedes a proposal from 2011-11-25.

Description of the change

add some security declarations for template statistics jobs

To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) wrote : Posted in a previous version of this proposal

Heh, actually this doens't need DB review per the DB review process - this is just a normal code review.

Revision history for this message
Robert Collins (lifeless) : Posted in a previous version of this proposal
review: Approve
Revision history for this message
Stuart Bishop (stub) wrote : Posted in a previous version of this proposal

yer

review: Approve
Revision history for this message
Benji York (benji) wrote :

Robert Collins wrote:
> Heh, actually this doens't need DB review per the DB review process -
> this is just a normal code review.

My mistake. Retargeting to devel.

Revision history for this message
Benji York (benji) wrote :

Well, since this was a branch of db-devel, that (retargeting won't work). I'll make a new branch with this content and self-approve with a comment pointing here.

Revision history for this message
Stuart Bishop (stub) wrote :

Normally this should land on db-devel. If you land it on devel, technically you would need someone to manually apply the permissions to production before landing. Otherwise, code landings may depend on the new permissions that have not been applied to the production db yet.

Unmerged revisions

11171. By Benji York

add some security declarations for template statistics jobs

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'database/replication/helpers.py'
--- database/replication/helpers.py 2011-10-13 03:52:48 +0000
+++ database/replication/helpers.py 2011-11-28 15:43:50 +0000
@@ -44,7 +44,6 @@
44 ('public', 'openidnonce'),44 ('public', 'openidnonce'),
45 ('public', 'openidassociation'),45 ('public', 'openidassociation'),
46 ('public', 'person'),46 ('public', 'person'),
47 ('public', 'launchpaddatabaserevision'),
48 ('public', 'databasereplicationlag'),47 ('public', 'databasereplicationlag'),
49 ('public', 'fticache'),48 ('public', 'fticache'),
50 ('public', 'nameblacklist'),49 ('public', 'nameblacklist'),
@@ -63,6 +62,16 @@
63 # suggestivepotemplate.potemplate foreign key constraint exists on62 # suggestivepotemplate.potemplate foreign key constraint exists on
64 # production.63 # production.
65 ('public', 'suggestivepotemplate'),64 ('public', 'suggestivepotemplate'),
65 # These are odd. They are updated via slonik & EXECUTE SCRIPT, and
66 # the contents of these tables will be different on each node
67 # because we store timestamps when the patches were applied.
68 # However, we want the tables listed as replicated so that, when
69 # building a new replica, the data that documents the schema patch
70 # level matches the schema patch level and upgrade.py does the right
71 # thing. This is a bad thing to do, but we are safe in this
72 # particular case.
73 ('public', 'launchpaddatabaserevision'),
74 ('public', 'launchpaddatabaseupdatelog'),
66 ])75 ])
6776
68# Explicitly list tables that should not be replicated. This includes the77# Explicitly list tables that should not be replicated. This includes the
6978
=== modified file 'database/schema/comments.sql'
--- database/schema/comments.sql 2011-11-16 01:19:54 +0000
+++ database/schema/comments.sql 2011-11-28 15:43:50 +0000
@@ -1223,6 +1223,9 @@
1223COMMENT ON COLUMN LaunchpadDatabaseRevision.minor IS 'Minor number. Patches made during development each increment the minor number.';1223COMMENT ON COLUMN LaunchpadDatabaseRevision.minor IS 'Minor number. Patches made during development each increment the minor number.';
1224COMMENT ON COLUMN LaunchpadDatabaseRevision.patch IS 'The patch number will hopefully always be ''0'', as it exists to support emergency patches made to the production server. eg. If production is running ''4.0.0'' and needs to have a patch applied ASAP, we would create a ''4.0.1'' patch and roll it out. We then may need to refactor all the existing ''4.x.0'' patches.';1224COMMENT ON COLUMN LaunchpadDatabaseRevision.patch IS 'The patch number will hopefully always be ''0'', as it exists to support emergency patches made to the production server. eg. If production is running ''4.0.0'' and needs to have a patch applied ASAP, we would create a ''4.0.1'' patch and roll it out. We then may need to refactor all the existing ''4.x.0'' patches.';
12251225
1226-- LaunchpadDatabaseUpdateLog
1227COMMENT ON TABLE LaunchpadDatabaseUpdateLog IS 'Record of Launchpad database schema updates. When and what update.py was run.';
1228
1226-- Karma1229-- Karma
1227COMMENT ON TABLE Karma IS 'Used to quantify all the ''operations'' a user performs inside the system, which maybe reporting and fixing bugs, uploading packages, end-user support, wiki editting, etc.';1230COMMENT ON TABLE Karma IS 'Used to quantify all the ''operations'' a user performs inside the system, which maybe reporting and fixing bugs, uploading packages, end-user support, wiki editting, etc.';
1228COMMENT ON COLUMN Karma.action IS 'A foreign key to the KarmaAction table.';1231COMMENT ON COLUMN Karma.action IS 'A foreign key to the KarmaAction table.';
12291232
=== added file 'database/schema/patch-2208-01-3.sql'
--- database/schema/patch-2208-01-3.sql 1970-01-01 00:00:00 +0000
+++ database/schema/patch-2208-01-3.sql 2011-11-28 15:43:50 +0000
@@ -0,0 +1,17 @@
1SET client_min_messages=ERROR;
2
3ALTER TABLE LaunchpadDatabaseRevision
4 ADD branch_nick text,
5 ADD revno integer,
6 ADD revid text;
7
8CREATE TABLE LaunchpadDatabaseUpdateLog (
9 id serial primary key,
10 start_time timestamp without time zone NOT NULL DEFAULT (
11 CURRENT_TIMESTAMP AT TIME ZONE 'UTC'),
12 end_time timestamp without time zone,
13 branch_nick text,
14 revno integer,
15 revid text);
16
17INSERT INTO LaunchpadDatabaseRevision VALUES (2208, 01, 3);
018
=== added file 'database/schema/patch-2208-93-2.sql'
--- database/schema/patch-2208-93-2.sql 1970-01-01 00:00:00 +0000
+++ database/schema/patch-2208-93-2.sql 2011-11-28 15:43:50 +0000
@@ -0,0 +1,13 @@
1-- Copyright 2011 Canonical Ltd. This software is licensed under the
2-- GNU Affero General Public License version 3 (see the file LICENSE).
3SET client_min_messages=ERROR;
4
5ALTER TABLE AccessPolicyGrant ADD CONSTRAINT
6 "accesspolicygrant_grantee_fkey" FOREIGN KEY (grantee) REFERENCES Person;
7ALTER TABLE AccessPolicyGrant ADD CONSTRAINT
8 "accesspolicygrant_grantor_fkey" FOREIGN KEY (grantor) REFERENCES Person;
9
10ALTER TABLE AccessPolicyArtifact ADD CONSTRAINT
11 "accesspolicyartifact_branch_fkey" FOREIGN KEY (branch) REFERENCES Branch;
12
13INSERT INTO LaunchpadDatabaseRevision VALUES (2208, 93, 2);
014
=== modified file 'database/schema/security.cfg'
--- database/schema/security.cfg 2011-11-22 14:12:40 +0000
+++ database/schema/security.cfg 2011-11-28 15:43:50 +0000
@@ -445,6 +445,9 @@
445public.job = SELECT, UPDATE, DELETE445public.job = SELECT, UPDATE, DELETE
446public.pofilestatsjob = SELECT, UPDATE, DELETE446public.pofilestatsjob = SELECT, UPDATE, DELETE
447public.potmsgset = SELECT447public.potmsgset = SELECT
448public.distroseries = SELECT
449public.distribution = SELECT
450public.sourcepackagename = SELECT
448public.translationmessage = SELECT451public.translationmessage = SELECT
449public.translationtemplateitem = SELECT452public.translationtemplateitem = SELECT
450type=user453type=user
451454
=== modified file 'lib/lp/code/doc/branch.txt'
--- lib/lp/code/doc/branch.txt 2011-05-27 19:53:20 +0000
+++ lib/lp/code/doc/branch.txt 2011-11-28 15:43:50 +0000
@@ -389,6 +389,7 @@
389 ... ])389 ... ])
390 >>> for name in listing:390 >>> for name in listing:
391 ... print name391 ... print name
392 accesspolicyartifact.branch
392 branch.stacked_on393 branch.stacked_on
393 branchjob.branch394 branchjob.branch
394 branchmergeproposal.dependent_branch395 branchmergeproposal.dependent_branch