

CREATE TABLE mod_errorreporter (
  er_uid          SERIAL                      NOT NULL PRIMARY KEY,
  er_date         TIMESTAMP WITHOUT TIME ZONE NOT NULL,
  er_act          TEXT                        NOT NULL
                  REFERENCES users(act)
                  ON DELETE CASCADE
                  ON UPDATE CASCADE,
  er_machine      TEXT                        NOT NULL,
  er_text         TEXT                        NOT NULL,
  er_status       SMALLINT                    NOT NULL DEFAULT 0,
  er_comment      TEXT,
  er_commentact   TEXT,
  er_hidden       BOOL
);

GRANT SELECT, INSERT, UPDATE, DELETE ON mod_errorreporter TO errorreporter;
GRANT SELECT, UPDATE ON mod_errorreporter_er_uid_seq TO errorreporter;
GRANT SELECT ON users TO errorreporter;
GRANT SELECT, INSERT ON log_module TO errorreporter;
GRANT INSERT ON log TO errorreporter;

