Index

public.error_occurrences

Description

One row per individual error report. References error_variants for exact deduplication. Rows expire after 2 months.

Columns

Name Type Default Nullable Children Parents Comment
app_version text true Frontend bundle version or backend git SHA at the time of this occurrence.
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.
details jsonb true Freeform JSON for any additional per-occurrence context.
error_variant_id uuid false public.error_variants The exact error variant this occurrence belongs to.
id uuid uuid_generate_v4() false A unique, stable identifier for the record.
path text true Page URL (frontend) or HTTP route (backend) where this occurrence happened.
service text false Service slug that reported the error. Kept in sync by application writes.
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.
user_id uuid true public.users The user who experienced this occurrence, if known.

Constraints

Name Type Definition
error_occurrences_created_at_not_null n NOT NULL created_at
error_occurrences_error_variant_id_fkey FOREIGN KEY FOREIGN KEY (error_variant_id) REFERENCES error_variants(id) ON DELETE RESTRICT
error_occurrences_error_variant_id_not_null n NOT NULL error_variant_id
error_occurrences_id_not_null n NOT NULL id
error_occurrences_pkey PRIMARY KEY PRIMARY KEY (id)
error_occurrences_service_not_null n NOT NULL service
error_occurrences_updated_at_not_null n NOT NULL updated_at
error_occurrences_user_id_fkey FOREIGN KEY FOREIGN KEY (user_id) REFERENCES users(id)

Indexes

Name Definition
error_occurrences_pkey CREATE UNIQUE INDEX error_occurrences_pkey ON public.error_occurrences USING btree (id)
idx_error_occurrences_user CREATE INDEX idx_error_occurrences_user ON public.error_occurrences USING btree (user_id, created_at DESC) WHERE ((user_id IS NOT NULL) AND (deleted_at IS NULL))
idx_error_occurrences_variant CREATE INDEX idx_error_occurrences_variant ON public.error_occurrences USING btree (error_variant_id, created_at DESC) WHERE (deleted_at IS NULL)

Triggers

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

Relations

er

Generated by tbls