Merge lp:~cjwatson/launchpad/db-git-subscriptions into lp:launchpad/db-devel

Proposed by Colin Watson
Status: Merged
Merged at revision: 12984
Proposed branch: lp:~cjwatson/launchpad/db-git-subscriptions
Merge into: lp:launchpad/db-devel
Diff against target: 82 lines (+39/-0)
2 files modified
database/schema/patch-2209-61-4.sql (+32/-0)
database/schema/security.cfg (+7/-0)
To merge this branch: bzr merge lp:~cjwatson/launchpad/db-git-subscriptions
Reviewer Review Type Date Requested Status
William Grant db Approve
Stuart Bishop db Pending
Review via email: mp+256370@code.launchpad.net

Commit message

Add GitSubscription table.

Description of the change

Add GitSubscription table.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (db)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'database/schema/patch-2209-61-4.sql'
2--- database/schema/patch-2209-61-4.sql 1970-01-01 00:00:00 +0000
3+++ database/schema/patch-2209-61-4.sql 2015-04-15 17:19:53 +0000
4@@ -0,0 +1,32 @@
5+-- Copyright 2015 Canonical Ltd. This software is licensed under the
6+-- GNU Affero General Public License version 3 (see the file LICENSE).
7+
8+SET client_min_messages=ERROR;
9+
10+CREATE TABLE GitSubscription (
11+ id serial PRIMARY KEY,
12+ person integer NOT NULL REFERENCES person,
13+ repository integer NOT NULL REFERENCES gitrepository,
14+ date_created timestamp without time zone DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'UTC') NOT NULL,
15+ notification_level integer DEFAULT 1 NOT NULL,
16+ max_diff_lines integer,
17+ review_level integer DEFAULT 0 NOT NULL,
18+ subscribed_by integer NOT NULL REFERENCES person
19+);
20+
21+CREATE INDEX gitsubscription__repository__idx
22+ ON GitSubscription(repository);
23+CREATE INDEX gitsubscription__subscribed_by__idx
24+ ON GitSubscription(subscribed_by);
25+CREATE UNIQUE INDEX gitsubscription__person__repository__key
26+ ON GitSubscription(person, repository);
27+
28+COMMENT ON TABLE GitSubscription IS 'An association between a person or team and a Git repository.';
29+COMMENT ON COLUMN GitSubscription.person IS 'The person or team associated with the repository.';
30+COMMENT ON COLUMN GitSubscription.repository IS 'The repository associated with the person or team.';
31+COMMENT ON COLUMN GitSubscription.notification_level IS 'The level of email the person wants to receive from repository updates.';
32+COMMENT ON COLUMN GitSubscription.max_diff_lines IS 'If the generated diff for a revision is larger than this number, then the diff is not sent in the notification email.';
33+COMMENT ON COLUMN GitSubscription.review_level IS 'The level of email the person wants to receive from review activity.';
34+COMMENT ON COLUMN GitSubscription.subscribed_by IS 'The person who created this subscription.';
35+
36+INSERT INTO LaunchpadDatabaseRevision VALUES (2209, 61, 4);
37
38=== modified file 'database/schema/security.cfg'
39--- database/schema/security.cfg 2015-03-11 23:41:40 +0000
40+++ database/schema/security.cfg 2015-04-15 17:19:53 +0000
41@@ -199,6 +199,7 @@
42 public.gitjob = SELECT, INSERT, UPDATE, DELETE
43 public.gitref = SELECT, INSERT, UPDATE, DELETE
44 public.gitrepository = SELECT, INSERT, UPDATE, DELETE
45+public.gitsubscription = SELECT, INSERT, UPDATE, DELETE
46 public.hwdevice = SELECT
47 public.hwdeviceclass = SELECT, INSERT, DELETE
48 public.hwdevicedriverlink = SELECT
49@@ -691,6 +692,7 @@
50 public.gitjob = SELECT, INSERT, UPDATE, DELETE
51 public.gitref = SELECT, INSERT, UPDATE, DELETE
52 public.gitrepository = SELECT, UPDATE
53+public.gitsubscription = SELECT
54 public.incrementaldiff = SELECT
55 public.job = SELECT, INSERT, UPDATE, DELETE
56 public.karma = SELECT, INSERT
57@@ -1972,6 +1974,7 @@
58 public.bugwatch = SELECT
59 public.distribution = SELECT
60 public.gitrepository = SELECT
61+public.gitsubscription = SELECT, UPDATE, DELETE
62 public.emailaddress = SELECT
63 public.job = SELECT, INSERT, UPDATE
64 public.person = SELECT
65@@ -2007,6 +2010,9 @@
66 public.distribution = SELECT
67 public.distroseries = SELECT
68 public.emailaddress = SELECT
69+public.gitjob = SELECT
70+public.gitrepository = SELECT
71+public.gitsubscription = SELECT
72 public.job = SELECT, INSERT, UPDATE
73 public.karma = SELECT, INSERT
74 public.karmaaction = SELECT
75@@ -2156,6 +2162,7 @@
76 public.faq = SELECT, UPDATE
77 public.featureflagchangelogentry = SELECT, UPDATE
78 public.gitrepository = SELECT, UPDATE
79+public.gitsubscription = SELECT, UPDATE, DELETE
80 public.gpgkey = SELECT, UPDATE
81 public.hwsubmission = SELECT, UPDATE
82 public.ircid = SELECT, UPDATE

Subscribers

People subscribed via source and target branches

to status/vote changes: