Index

public.credit_registration_daily_step_snapshots

Description

Daily count of live registrations per timeline step, split by engagement on the steps that wait on the student. Counted with the same rules as the overview, so a day’s row equals what the overview showed then. No history before the table existed.

Columns

Name Type Default Nullable Children Parents Comment
count integer false Live registrations at the step when the snapshot was taken.
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.
engagement credit_registration_engagement true The engagement counted, on the steps that wait on the student; NULL on every other step.
id uuid uuid_generate_v4() false A unique, stable identifier for the record.
snapshot_date date false The UTC day this row describes.
timeline_step credit_registration_timeline_step false The timeline step counted.
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_daily_step_snapshots_count CHECK CHECK ((count >= 0))
credit_registration_daily_step_snapshots_count_not_null n NOT NULL count
credit_registration_daily_step_snapshots_created_at_not_null n NOT NULL created_at
credit_registration_daily_step_snapshots_id_not_null n NOT NULL id
credit_registration_daily_step_snapshots_pkey PRIMARY KEY PRIMARY KEY (id)
credit_registration_daily_step_snapshots_snapshot_date_not_null n NOT NULL snapshot_date
credit_registration_daily_step_snapshots_timeline_step_not_null n NOT NULL timeline_step
credit_registration_daily_step_snapshots_updated_at_not_null n NOT NULL updated_at

Indexes

Name Definition
credit_registration_daily_step_snapshots_pkey CREATE UNIQUE INDEX credit_registration_daily_step_snapshots_pkey ON public.credit_registration_daily_step_snapshots USING btree (id)
uq_credit_registration_daily_step_snapshots CREATE UNIQUE INDEX uq_credit_registration_daily_step_snapshots ON public.credit_registration_daily_step_snapshots USING btree (snapshot_date, timeline_step, engagement, deleted_at) NULLS NOT DISTINCT

Triggers

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

Relations

er

Generated by tbls