Mercurial > ~dholland > hg > swallowtail > index.cgi
changeset 43:debc55088b4f
add administrative queue
author | David A. Holland |
---|---|
date | Sun, 15 Jun 2014 18:16:19 -0400 |
parents | e1017d556437 |
children | 812c956dd0e9 |
files | database/schema.sql database/schema/admin.sql |
diffstat | 2 files changed, 36 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/database/schema.sql Sun Jun 15 18:16:12 2014 -0400 +++ b/database/schema.sql Sun Jun 15 18:16:19 2014 -0400 @@ -16,6 +16,8 @@ \ir schema/logs.sql +\ir schema/admin.sql + commit;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/database/schema/admin.sql Sun Jun 15 18:16:19 2014 -0400 @@ -0,0 +1,34 @@ +-- +-- Queue of administrative requests. +-- +-- The following things appear in the admin queue: +-- * comments filed on locked PRs +-- * bounce mail (for feedback messages, for other messages) +-- * junk mail (unrecognized incoming mail) +-- +-- These all are associated with incoming messages and refer to the +-- rawmail table. The pr and user fields are not null if we can figure +-- out what it's about, which we sometimes can but often can't. +-- + +CREATE TABLE adminmailtypes ( + type text primary key, + desc text +) +WITHOUT OIDS; + +-- this is not configurable as the logic for recognizing these is open-coded +-- XXX should probably use an enum type for this instead +INSERT INTO adminmaintypes VALUES ('locked', 'Comments on locked PRs'); +INSERT INTO adminmaintypes VALUES ('fbounces', 'Feedback nag-mail bounces'); +INSERT INTO adminmaintypes VALUES ('rbounces', 'Responsible nag-mail bounces'); +INSERT INTO adminmaintypes VALUES ('bounces', 'Other bounces'); +INSERT INTO adminmaintypes VALUES ('junk', 'Unrecognized mail traffic'); + +CREATE TABLE adminmailqueue ( + rawmsg bigint not null references rawmail, + type text not null references adminmailtypes, + pr bigint null references PRs, + user bigint null references users +) +WITHOUT OIDS;