Index

public.credit_registration_phase_state

Description

One row per pipeline phase, not per worker process. Phases are what an operator reasons about, what the dashboard lists and what the system tests tick individually. Rows are seeded by migration and thereafter only ever updated.

Columns

Name Type Default Nullable Children Parents Comment
consecutive_failures integer 0 false Observable copy of the in-process circuit-breaker counter, written each tick.
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.
expected_interval_secs integer false How often the phase is expected to run. Persisted rather than hardcoded in the frontend because the “phase is down” rule is evaluated server-side and rendered client-side, and it should be one number in one place.
id uuid uuid_generate_v4() false A unique, stable identifier for the record.
items_failed_last_run integer true How many items the last iteration failed on.
items_processed_last_run integer true How many items the last iteration handled.
last_error text true The last error the phase recorded.
last_heartbeat_at timestamp with time zone true Written on every iteration whether or not there was work, so idle and wedged are distinguishable.
last_run_finished_at timestamp with time zone true When the phase last finished an iteration.
last_run_started_at timestamp with time zone true When the phase last began an iteration.
last_success_at timestamp with time zone true When the phase last completed a unit of work without error.
next_run_at timestamp with time zone true When the phase should next run. Setting it to now() is how the admin run-now action works, using the same mechanism the phase already uses for its own scheduling.
pause_reason text true Why the phase was paused.
paused_at timestamp with time zone true While set, the phase skips its body. A phase flag rather than scaling a deployment to zero, because half the phases are database-only and useful during a Suotar outage.
paused_by_user_id uuid true public.users Who paused the phase.
phase varchar(64) false The canonical phase name, used verbatim here, in the test tick endpoint, in the dashboard and in the audit log.
process_name varchar(64) false Which worker process runs this phase.
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
credit_registration_phase_state_consecutive_failures_not_null n NOT NULL consecutive_failures
credit_registration_phase_state_created_at_not_null n NOT NULL created_at
credit_registration_phase_state_expected_interval_secs_not_null n NOT NULL expected_interval_secs
credit_registration_phase_state_id_not_null n NOT NULL id
credit_registration_phase_state_paused_by_user_id_fkey FOREIGN KEY FOREIGN KEY (paused_by_user_id) REFERENCES users(id)
credit_registration_phase_state_phase_not_null n NOT NULL phase
credit_registration_phase_state_pkey PRIMARY KEY PRIMARY KEY (id)
credit_registration_phase_state_process_name_not_null n NOT NULL process_name
credit_registration_phase_state_updated_at_not_null n NOT NULL updated_at

Indexes

Name Definition
credit_registration_phase_state_pkey CREATE UNIQUE INDEX credit_registration_phase_state_pkey ON public.credit_registration_phase_state USING btree (id)
uq_credit_registration_phase_state_phase CREATE UNIQUE INDEX uq_credit_registration_phase_state_phase ON public.credit_registration_phase_state USING btree (phase, deleted_at) NULLS NOT DISTINCT

Triggers

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

Relations

er

Generated by tbls