Index

public.open_university_product_access_tokens

Description

Access tokens used to build working Sisu enrolment links for open university products. The last good token is kept when a refresh fails on purpose: a link that works with a slightly stale token beats a broken page.

Columns

Name Type Default Nullable Children Parents Comment
access_token varchar(255) false The token itself. A secret: it must never reach a log line or a stored Suotar body sample.
consecutive_failures integer 0 false How many refreshes have failed in a row. Drives the amber or red badge on the admin dashboard.
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.
document_state varchar(64) false Document state as Suotar reports it.
id uuid uuid_generate_v4() false A unique, stable identifier for the record.
last_refresh_error text true Why the last refresh failed.
last_refresh_failed_at timestamp with time zone true When a refresh last failed.
last_refreshed_at timestamp with time zone now() false When the token was last successfully refreshed.
open_university_product_id varchar(255) false The open university product the token is for.
state varchar(64) false Token state as Suotar reports it.
suotar_token_id varchar(255) true Suotar-side identifier for this token, for support conversations.
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.

Viewpoints

Name Definition
Credit registration How a completed course module becomes a credit in the University of Helsinki study registry. Once the student has consented for the course and holds a student number proven to be theirs, one ledger row per completion is pushed to Sisu through Suotar and polled until the registry confirms the attainment.

Constraints

Name Type Definition
open_university_product_acc_open_university_product_id_not_null n NOT NULL open_university_product_id
open_university_product_access_to_consecutive_failures_not_null n NOT NULL consecutive_failures
open_university_product_access_token_last_refreshed_at_not_null n NOT NULL last_refreshed_at
open_university_product_access_tokens_access_token_not_null n NOT NULL access_token
open_university_product_access_tokens_created_at_not_null n NOT NULL created_at
open_university_product_access_tokens_document_state_not_null n NOT NULL document_state
open_university_product_access_tokens_id_not_null n NOT NULL id
open_university_product_access_tokens_pkey PRIMARY KEY PRIMARY KEY (id)
open_university_product_access_tokens_state_not_null n NOT NULL state
open_university_product_access_tokens_updated_at_not_null n NOT NULL updated_at

Indexes

Name Definition
open_university_product_access_tokens_pkey CREATE UNIQUE INDEX open_university_product_access_tokens_pkey ON public.open_university_product_access_tokens USING btree (id)
uq_ou_product_access_tokens_product CREATE UNIQUE INDEX uq_ou_product_access_tokens_product ON public.open_university_product_access_tokens USING btree (open_university_product_id, deleted_at) NULLS NOT DISTINCT

Triggers

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

Relations

er

Generated by tbls