Index

public.credit_registration_attention_dismissals

Description

An admin taking a registration off the Needs attention queue. Separate from credit_registrations.needs_admin_attention, which is the pipeline’s own flag. The row stays off the queue while every reason it carries is one the dismissal covered; a different reason firing brings it back. A newer dismissal of the same registration soft-deletes the older one.

Columns

Name Type Default Nullable Children Parents Comment
created_at timestamp with time zone now() false Timestamp when the record was created: when it was dismissed.
credit_registration_id uuid false public.credit_registrations The registration taken off the queue.
deleted_at timestamp with time zone true Timestamp when the record was deleted. If null, the record is not deleted.
dismissed_by_user_id uuid false public.users The admin who dismissed it.
dismissed_reasons credit_registration_attention_reason[] false The reasons the registration carried when dismissed.
id uuid uuid_generate_v4() false A unique, stable identifier for the record.
reason text false Why, in the admin’s words. Also on the dismiss_attention audit row.
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_attention_d_credit_registration_id_not_null n NOT NULL credit_registration_id
credit_registration_attention_dis_dismissed_by_user_id_not_null n NOT NULL dismissed_by_user_id
credit_registration_attention_dismi_credit_registration_id_fkey FOREIGN KEY FOREIGN KEY (credit_registration_id) REFERENCES credit_registrations(id)
credit_registration_attention_dismis_dismissed_reasons_not_null n NOT NULL dismissed_reasons
credit_registration_attention_dismiss_dismissed_by_user_id_fkey FOREIGN KEY FOREIGN KEY (dismissed_by_user_id) REFERENCES users(id)
credit_registration_attention_dismissals_created_at_not_null n NOT NULL created_at
credit_registration_attention_dismissals_id_not_null n NOT NULL id
credit_registration_attention_dismissals_pkey PRIMARY KEY PRIMARY KEY (id)
credit_registration_attention_dismissals_reason CHECK CHECK ((TRIM(BOTH FROM reason) <> ’’::text))
credit_registration_attention_dismissals_reason_not_null n NOT NULL reason
credit_registration_attention_dismissals_reasons CHECK CHECK ((cardinality(dismissed_reasons) > 0))
credit_registration_attention_dismissals_updated_at_not_null n NOT NULL updated_at

Indexes

Name Definition
credit_registration_attention_dismissals_pkey CREATE UNIQUE INDEX credit_registration_attention_dismissals_pkey ON public.credit_registration_attention_dismissals USING btree (id)
idx_credit_registration_attention_dismissals_created CREATE INDEX idx_credit_registration_attention_dismissals_created ON public.credit_registration_attention_dismissals USING btree (created_at DESC) WHERE (deleted_at IS NULL)
uq_credit_registration_attention_dismissals_registration CREATE UNIQUE INDEX uq_credit_registration_attention_dismissals_registration ON public.credit_registration_attention_dismissals USING btree (credit_registration_id) WHERE (deleted_at IS NULL)

Triggers

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

Relations

er

Generated by tbls