Index

public.feedback

Description

Users can send feedback to help improve the course material. Feedback consists of written text from the user.

Columns

Name Type Default Nullable Children Parents Comment
course_id uuid true public.courses The course the feedback is for.
created_at timestamp with time zone now() false Timestamp when the record was created.
deleted_at timestamp with time zone true Timestamp when the record was deleted. If null, the record is not deleted.
exam_id uuid true public.exams The exam the feedback is associated with.
feedback_given varchar(1000) false The feedback the user wrote.
id uuid uuid_generate_v4() false public.block_feedback A unique, stable identifier for the record.
marked_as_read boolean false false
page_id uuid true public.pages A number that tells the order of the blocks.
selected_text text true The text the student selected to give feedback on.
updated_at timestamp with time zone now() false Timestamp when the record was last updated. The field is updated automatically by the set_timestamp trigger.
user_id uuid true public.users The user that sent the feedback.

Constraints

Name Type Definition Comment
course_or_exam_id_set CHECK CHECK (((course_id IS NULL) <> (exam_id IS NULL))) A feedback must be associated with either a course or an exam.
feedback_course_id_fkey FOREIGN KEY FOREIGN KEY (course_id) REFERENCES courses(id)
feedback_exam_id_fkey FOREIGN KEY FOREIGN KEY (exam_id) REFERENCES exams(id)
feedback_page_id_fkey FOREIGN KEY FOREIGN KEY (page_id) REFERENCES pages(id)
feedback_pkey PRIMARY KEY PRIMARY KEY (id)
feedback_user_id_fkey FOREIGN KEY FOREIGN KEY (user_id) REFERENCES users(id)

Indexes

Name Definition
feedback_pkey CREATE UNIQUE INDEX feedback_pkey ON public.feedback USING btree (id)

Triggers

Name Definition
set_timestamp CREATE TRIGGER set_timestamp BEFORE UPDATE ON public.feedback FOR EACH ROW EXECUTE FUNCTION trigger_set_timestamp()

Relations

er

Generated by tbls