Index

public.credit_registration_roster_schedules

Description

When enrolment discovery fetches each course code’s enrolment list. Every fetch falls on the code’s own grid, points 20 minutes apart at an offset fixed per code, so codes spread evenly over the hour. A code is due weekly, and sooner while people waiting for a student number on its modules are due on their ladders; both are derived at claim time, so only what cannot be derived is kept here. Modules sharing a code share its row. No deleted_at: a row belongs to a course code, not to anything that is deleted, and one no module uses any more is simply never claimed.

Columns

Name Type Default Nullable Children Parents Comment
consecutive_failures integer 0 false Failed listings of the code on its own since the last success. Drives the per-code backoff and the admin alert.
course_code varchar(255) false The trimmed uh_course_code the roster is listed by.
created_at timestamp with time zone now() false Timestamp when the record was created.
fetch_day date true The UTC day fetch_day_count counts.
fetch_day_count integer 0 false How many fetches of the code were sent on fetch_day, for whatever reason. Once at the daily cap, only the weekly fetch and an admin’s fetch request make the code due until the next UTC day.
fetch_requested_at timestamp with time zone true When an admin last asked for the enrolment list to be fetched. Until a fetch started after it arrives, the code is due at its next grid point; the rate limiter and the failure backoff still apply.
id uuid uuid_generate_v4() false A unique, stable identifier for the record.
is_fetched_alone boolean false false Set when a request batching this code with others failed as a whole: Suotar fails every code of a request for one bad one, so the code is listed on its own until a listing of it succeeds.
last_attempted_at timestamp with time zone true When a listing of the code was last sent, whether or not it arrived.
last_error credit_registration_error_code true Why the last listing of the code failed; NULL once one succeeds.
last_fetch_duration_ms integer true How long the request that last brought the roster took, in milliseconds. Shared by every code in that request.
last_fetch_started_at timestamp with time zone true When the fetch behind last_fetched_at was sent. An admin’s fetch request is served only by a fetch sent after it, since one already in flight may have read the list before the request.
last_fetched_at timestamp with time zone true When the enrolment list last arrived, or Suotar last said it holds no realisation of the code. The weekly fetch and the minimum gap between fetches are counted from here.
last_listed_person_count integer true How many enrolments the last roster listed.
last_mailing_fetch_started_at timestamp with time zone true When the latest arrived fetch that could claim linking mail was sent, that is one made with account linking on and link-emails not paused. A waiting person’s rungs and “I have enrolled” presses count as served from here.
linking_already_linked_count integer true Of linking_listed_count, those some account already holds a student number link for.
linking_listed_count integer true Distinct people on the last enrolment list that fed account linking, of those enrolled since account linking began. Each is counted once however many modules share the code, in exactly one of the other linking_ counters. NULL until such a list arrives.
linking_mailed_count integer true Of linking_listed_count, those a linking email was claimed for on at least one course.
linking_no_address_count integer true Of linking_listed_count, those the study registry holds no address for.
linking_suppressed_by_dedup_count integer true Of linking_listed_count, those mailed on no course because an earlier mail still had a usable link on at least one.
linking_suppressed_by_rate_cap_count integer true Of linking_listed_count, those mailed on no course and held back only by the rate caps.
linking_unlinked_enrolled_before_count integer true Distinct people on the last enrolment list that fed account linking who enrolled before account linking began, or with no enrolment time, and whom no account is linked to. Linking mails skip them, so a student among them waits for a student number until an admin acts. Outside linking_listed_count. NULL until such a list arrives.
retry_not_before timestamp with time zone true Until when the code is left alone after failing on its own.
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
credit_registration_roster_schedu_consecutive_failures_not_null n NOT NULL consecutive_failures
credit_registration_roster_schedules_counts CHECK CHECK (((consecutive_failures >= 0) AND (fetch_day_count >= 0)))
credit_registration_roster_schedules_course_code_not_null n NOT NULL course_code
credit_registration_roster_schedules_created_at_not_null n NOT NULL created_at
credit_registration_roster_schedules_fetch_day_count_not_null n NOT NULL fetch_day_count
credit_registration_roster_schedules_id_not_null n NOT NULL id
credit_registration_roster_schedules_is_fetched_alone_not_null n NOT NULL is_fetched_alone
credit_registration_roster_schedules_pkey PRIMARY KEY PRIMARY KEY (id)
credit_registration_roster_schedules_updated_at_not_null n NOT NULL updated_at

Indexes

Name Definition
credit_registration_roster_schedules_pkey CREATE UNIQUE INDEX credit_registration_roster_schedules_pkey ON public.credit_registration_roster_schedules USING btree (id)
uq_credit_registration_roster_schedules_course_code CREATE UNIQUE INDEX uq_credit_registration_roster_schedules_course_code ON public.credit_registration_roster_schedules USING btree (course_code)

Triggers

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

Relations

er

Generated by tbls