Index

public.code_giveaways

Description

With a code giveaway you can create a list of codes that can be distributed to students that complete a course module. To use the giveaway, the teacher needs to add a block to the course materil for the giveaway.

Columns

Name Type Default Nullable Children Parents Comment
course_id uuid false public.courses The course the code giveaway is available on.
course_module_id uuid true public.course_modules The course module the code giveaway is available on. If null, the giveaway has not been placed on a course module on the CMS.
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.
enabled boolean true false If the giveaway is enabled, the codes can be given to students.
id uuid uuid_generate_v4() false public.code_giveaway_codes A unique, stable identifier for the record.
name varchar(2048) false The name of the giveaway.
require_course_specific_consent_form_question_id uuid true public.course_specific_consent_form_questions If not null, the student needs to consent to this question to receive a code from the giveaway.
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.

Constraints

Name Type Definition
code_giveaways_course_id_fkey FOREIGN KEY FOREIGN KEY (course_id) REFERENCES courses(id)
code_giveaways_course_module_id_fkey FOREIGN KEY FOREIGN KEY (course_module_id) REFERENCES course_modules(id)
code_giveaways_pkey PRIMARY KEY PRIMARY KEY (id)
code_giveaways_require_course_specific_consent_form_questi_fkey FOREIGN KEY FOREIGN KEY (require_course_specific_consent_form_question_id) REFERENCES course_specific_consent_form_questions(id)

Indexes

Name Definition
code_giveaways_pkey CREATE UNIQUE INDEX code_giveaways_pkey ON public.code_giveaways USING btree (id)

Triggers

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

Relations

er

Generated by tbls