view 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
line wrap: on
line source

--
-- 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;