Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Feedback system #31

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/target
*.db
.env

.idea/
.vscode/settings.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions migrations/20240823213817_add_feedback.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-- Add down migration script here

DROP TABLE IF EXISTS mod_feedback;
DROP TYPE IF EXISTS feedback_type;
DROP INDEX IF EXISTS idx_mod_feedback_mod_version_id;
DROP INDEX IF EXISTS idx_mod_feedback_reviewer_id;
28 changes: 28 additions & 0 deletions migrations/20240823213817_add_feedback.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-- Add up migration script here

CREATE TYPE feedback_type AS ENUM
('Positive', 'Negative', 'Suggestion', 'Note');

CREATE TABLE mod_feedback
(
id SERIAL PRIMARY KEY NOT NULL,
mod_version_id INTEGER NOT NULL,
reviewer_id INTEGER NOT NULL,
feedback TEXT COLLATE pg_catalog."default" NOT NULL,
decision BOOLEAN NOT NULL DEFAULT false,
qimiko marked this conversation as resolved.
Show resolved Hide resolved
type feedback_type NOT NULL,
dev bool NOT NULL DEFAULT false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could get a little confusing, considering that "this person is a developer of this mod" is not constant. i'd rather this check be done during the sql query (like the admin field) instead of stored in the table

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah alr

created_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT mod_feedback_mod_version_id_fkey FOREIGN KEY (mod_version_id)
REFERENCES public.mod_versions (id)
ON DELETE CASCADE,
CONSTRAINT mod_feedback_reviewer_id_fkey FOREIGN KEY (reviewer_id)
REFERENCES public.developers (id)
ON DELETE CASCADE
);
SorkoPiko marked this conversation as resolved.
Show resolved Hide resolved

CREATE INDEX idx_mod_feedback_mod_version_id
ON public.mod_feedback (mod_version_id);

CREATE INDEX idx_mod_feedback_reviewer_id
ON public.mod_feedback (reviewer_id);
Loading