Index

public.study_registry_student_number_conflicts

Description

Student numbers a registrar reported for an account that could not become its study_registry link because a live link already stood in the way: the account’s own link, or a link someone made by hand on that number. Another account’s study_registry link does not block; it moves to the reported account. A row stops mattering once the account holds the reported number.

Columns

Name Type Default Nullable Children Parents Comment
conflicting_verified_student_number_id uuid false public.verified_student_numbers The live link that stood in the way: the account’s own link to another number, or another account’s link to this number.
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.
id uuid uuid_generate_v4() false A unique, stable identifier for the record.
registered_completion_id uuid false public.course_module_completion_registered_to_study_registries The registrar’s record the number came from.
student_number varchar(32) false The number the registrar reported, whitespace stripped.
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 false public.users The account whose completion the registrar reported.

Constraints

Name Type Definition
study_registry_student_numb_conflicting_verified_stude_not_null n NOT NULL conflicting_verified_student_number_id
study_registry_student_number_con_registered_completion_id_fkey FOREIGN KEY FOREIGN KEY (registered_completion_id) REFERENCES course_module_completion_registered_to_study_registries(id)
study_registry_student_number_conflicting_verified_student_fkey FOREIGN KEY FOREIGN KEY (conflicting_verified_student_number_id) REFERENCES verified_student_numbers(id)
study_registry_student_number_conflicts_created_at_not_null n NOT NULL created_at
study_registry_student_number_conflicts_id_not_null n NOT NULL id
study_registry_student_number_conflicts_pkey PRIMARY KEY PRIMARY KEY (id)
study_registry_student_number_conflicts_student_number_not_null n NOT NULL student_number
study_registry_student_number_conflicts_updated_at_not_null n NOT NULL updated_at
study_registry_student_number_conflicts_user_id_fkey FOREIGN KEY FOREIGN KEY (user_id) REFERENCES users(id)
study_registry_student_number_conflicts_user_id_not_null n NOT NULL user_id
study_registry_student_number_registered_completion_id_not_null n NOT NULL registered_completion_id

Indexes

Name Definition
study_registry_student_number_conflicts_pkey CREATE UNIQUE INDEX study_registry_student_number_conflicts_pkey ON public.study_registry_student_number_conflicts USING btree (id)
uq_study_registry_student_number_conflicts CREATE UNIQUE INDEX uq_study_registry_student_number_conflicts ON public.study_registry_student_number_conflicts USING btree (user_id, student_number, deleted_at) NULLS NOT DISTINCT

Triggers

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

Relations

er

Generated by tbls