annotate database/schema/admin.sql @ 43:debc55088b4f

add administrative queue
author David A. Holland
date Sun, 15 Jun 2014 18:16:19 -0400
parents
children 812c956dd0e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
43
debc55088b4f add administrative queue
David A. Holland
parents:
diff changeset
1 --
debc55088b4f add administrative queue
David A. Holland
parents:
diff changeset
2 -- Queue of administrative requests.
debc55088b4f add administrative queue
David A. Holland
parents:
diff changeset
3 --
debc55088b4f add administrative queue
David A. Holland
parents:
diff changeset
4 -- The following things appear in the admin queue:
debc55088b4f add administrative queue
David A. Holland
parents:
diff changeset
5 -- * comments filed on locked PRs
debc55088b4f add administrative queue
David A. Holland
parents:
diff changeset
6 -- * bounce mail (for feedback messages, for other messages)
debc55088b4f add administrative queue
David A. Holland
parents:
diff changeset
7 -- * junk mail (unrecognized incoming mail)
debc55088b4f add administrative queue
David A. Holland
parents:
diff changeset
8 --
debc55088b4f add administrative queue
David A. Holland
parents:
diff changeset
9 -- These all are associated with incoming messages and refer to the
debc55088b4f add administrative queue
David A. Holland
parents:
diff changeset
10 -- rawmail table. The pr and user fields are not null if we can figure
debc55088b4f add administrative queue
David A. Holland
parents:
diff changeset
11 -- out what it's about, which we sometimes can but often can't.
debc55088b4f add administrative queue
David A. Holland
parents:
diff changeset
12 --
debc55088b4f add administrative queue
David A. Holland
parents:
diff changeset
13
debc55088b4f add administrative queue
David A. Holland
parents:
diff changeset
14 CREATE TABLE adminmailtypes (
debc55088b4f add administrative queue
David A. Holland
parents:
diff changeset
15 type text primary key,
debc55088b4f add administrative queue
David A. Holland
parents:
diff changeset
16 desc text
debc55088b4f add administrative queue
David A. Holland
parents:
diff changeset
17 )
debc55088b4f add administrative queue
David A. Holland
parents:
diff changeset
18 WITHOUT OIDS;
debc55088b4f add administrative queue
David A. Holland
parents:
diff changeset
19
debc55088b4f add administrative queue
David A. Holland
parents:
diff changeset
20 -- this is not configurable as the logic for recognizing these is open-coded
debc55088b4f add administrative queue
David A. Holland
parents:
diff changeset
21 -- XXX should probably use an enum type for this instead
debc55088b4f add administrative queue
David A. Holland
parents:
diff changeset
22 INSERT INTO adminmaintypes VALUES ('locked', 'Comments on locked PRs');
debc55088b4f add administrative queue
David A. Holland
parents:
diff changeset
23 INSERT INTO adminmaintypes VALUES ('fbounces', 'Feedback nag-mail bounces');
debc55088b4f add administrative queue
David A. Holland
parents:
diff changeset
24 INSERT INTO adminmaintypes VALUES ('rbounces', 'Responsible nag-mail bounces');
debc55088b4f add administrative queue
David A. Holland
parents:
diff changeset
25 INSERT INTO adminmaintypes VALUES ('bounces', 'Other bounces');
debc55088b4f add administrative queue
David A. Holland
parents:
diff changeset
26 INSERT INTO adminmaintypes VALUES ('junk', 'Unrecognized mail traffic');
debc55088b4f add administrative queue
David A. Holland
parents:
diff changeset
27
debc55088b4f add administrative queue
David A. Holland
parents:
diff changeset
28 CREATE TABLE adminmailqueue (
debc55088b4f add administrative queue
David A. Holland
parents:
diff changeset
29 rawmsg bigint not null references rawmail,
debc55088b4f add administrative queue
David A. Holland
parents:
diff changeset
30 type text not null references adminmailtypes,
debc55088b4f add administrative queue
David A. Holland
parents:
diff changeset
31 pr bigint null references PRs,
debc55088b4f add administrative queue
David A. Holland
parents:
diff changeset
32 user bigint null references users
debc55088b4f add administrative queue
David A. Holland
parents:
diff changeset
33 )
debc55088b4f add administrative queue
David A. Holland
parents:
diff changeset
34 WITHOUT OIDS;