1 CREATE TABLE private_message_report (
3 creator_id int REFERENCES person ON UPDATE CASCADE ON DELETE CASCADE NOT NULL, -- user reporting comment
4 private_message_id int REFERENCES private_message ON UPDATE CASCADE ON DELETE CASCADE NOT NULL, -- comment being reported
5 original_pm_text text NOT NULL,
7 resolved bool NOT NULL DEFAULT FALSE,
8 resolver_id int REFERENCES person ON UPDATE CASCADE ON DELETE CASCADE, -- user resolving report
9 published timestamp NOT NULL DEFAULT now(),
10 updated timestamp NULL,
11 UNIQUE (private_message_id, creator_id) -- users should only be able to report a pm once