You've already forked AstralRinth
forked from didirus/AstralRinth
Reports (#165)
* Reports WIP * Finish reports * Clippy fixes Co-authored-by: Geometrically <geometrically@pop-os.localdomain>
This commit is contained in:
24
migrations/20210201001429_reports.sql
Normal file
24
migrations/20210201001429_reports.sql
Normal 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;
|
||||
Reference in New Issue
Block a user