Moderation Stage

Tables for storing moderation stage data. WIP.

Moderation Stage Diagram



erd

Catalyst Event Database Moderation Stage


moderation


moderation

Column

Type

Description


row_id


integer+


Synthetic ID of this moderation.

review_id

integer

The review the moderation is related to.

user_id

integer

The user the moderation is submitted
from.

classification

integer

The value used to describe the
moderation (e.g. 0: excluded, 1:
included).

rationale

varchar

The rationale for the given
classification.


An individual moderation for a proposal review.



config


config

Column

row_id


ABRIDGED



moderation:user_id_out->config:row_id





proposal_review


proposal_review

Column

row_id


ABRIDGED



moderation:review_id_out->proposal_review:row_id





moderation_allocation


moderation_allocation

Column

Type

Description


row_id


integer+


Synthetic ID of this relationship.

review_id

integer

The review the relationship is related
to.

user_id

integer

The user the relationship is related to.


The relationship between users and proposals_reviews.



moderation_allocation:user_id_out->config:row_id





moderation_allocation:review_id_out->proposal_review:row_id





LEGEND


LEGEND

Type

Example


Primary Key


integer+

Standard Field

bytea

Nullable Field

text

Sized Field

varchar(32)

Autoincrement Field

integer+



Schema

-- Catalyst Event Database

-- ModerationAllocation - Defines the relationship between users and proposals_reviews
-- to describe the allocation of moderations that needs to be done.

CREATE TABLE moderation_allocation (
  row_id SERIAL PRIMARY KEY,
  review_id INTEGER NOT NULL,
  user_id INTEGER NOT NULL,

  FOREIGN KEY (review_id) REFERENCES proposal_review(row_id) ON DELETE CASCADE,
  FOREIGN KEY (user_id) REFERENCES config(row_id) ON DELETE CASCADE
);


COMMENT ON TABLE moderation_allocation IS 'The relationship between users and proposals_reviews.';
COMMENT ON COLUMN moderation_allocation.row_id IS 'Synthetic ID of this relationship.';
COMMENT ON COLUMN moderation_allocation.review_id IS 'The review the relationship is related to.';
COMMENT ON COLUMN moderation_allocation.user_id IS 'The user the relationship is related to.';


-- Moderation - Defines the moderation submitted by users for each proposal_review.

CREATE TABLE moderation (
  row_id SERIAL PRIMARY KEY,
  review_id INTEGER NOT NULL,
  user_id INTEGER NOT NULL,
  classification INTEGER NOT NULL,
  rationale VARCHAR,
  UNIQUE (review_id, user_id),

  FOREIGN KEY (review_id) REFERENCES proposal_review(row_id) ON DELETE CASCADE,
  FOREIGN KEY (user_id) REFERENCES config(row_id) ON DELETE CASCADE
);


COMMENT ON TABLE moderation IS 'An individual moderation for a proposal review.';
COMMENT ON COLUMN moderation.row_id IS 'Synthetic ID of this moderation.';
COMMENT ON COLUMN moderation.review_id IS 'The review the moderation is related to.';
COMMENT ON COLUMN moderation.user_id IS 'The user the moderation is submitted from.';
COMMENT ON COLUMN moderation.classification IS 'The value used to describe the moderation (e.g. 0: excluded, 1: included).';
COMMENT ON COLUMN moderation.rationale IS 'The rationale for the given classification.';