* Reports WIP

* Finish reports

* Clippy fixes

Co-authored-by: Geometrically <geometrically@pop-os.localdomain>
This commit is contained in:
Geometrically
2021-02-13 12:11:13 -07:00
committed by GitHub
parent 3df740702c
commit 109d7d87bd
21 changed files with 1158 additions and 238 deletions

View File

@@ -0,0 +1,24 @@
CREATE TABLE report_types (
id serial PRIMARY KEY,
name varchar(64) UNIQUE NOT NULL
);
INSERT INTO report_types (name) VALUES ('spam');
INSERT INTO report_types (name) VALUES ('copyright');
INSERT INTO report_types (name) VALUES ('inappropriate');
INSERT INTO report_types (name) VALUES ('malicious');
INSERT INTO report_types (name) VALUES ('name-squatting');
CREATE TABLE reports (
id bigint PRIMARY KEY,
report_type_id int REFERENCES report_types ON UPDATE CASCADE NOT NULL,
mod_id bigint REFERENCES mods ON UPDATE CASCADE,
version_id bigint REFERENCES versions ON UPDATE CASCADE,
user_id bigint REFERENCES users ON UPDATE CASCADE,
body varchar(65536) NOT NULL,
reporter bigint REFERENCES users ON UPDATE CASCADE NOT NULL,
created timestamptz DEFAULT CURRENT_TIMESTAMP NOT NULL
);
ALTER TABLE game_versions
ADD COLUMN major boolean NOT NULL DEFAULT FALSE;