Index

public.page_history_spec_files

Description

The files each page-history version’s private specs reference. Only the private ones: restoring a version re-stores its private spec and the derived specs are produced from it again, so an old version’s derived files are never needed. Append-only, because history is: a restore must be able to bring back a version whose specs name these files, so a file stays out of the reaper’s reach for as long as any snapshot names it. The consequence is deliberate – with history retained indefinitely, a file that ever reached a saved spec is effectively never reclaimed, and what the reaper collects is uploads that never made it into a save at all.

Columns

Name Type Default Nullable Children Parents Comment
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.
file_upload_id uuid false public.file_uploads The referenced file.
id uuid uuid_generate_v4() false A unique, stable identifier for the record.
page_history_id uuid false public.page_history The history version whose specs reference the file.
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
page_history_spec_files_created_at_not_null n NOT NULL created_at
page_history_spec_files_file_upload_id_fkey FOREIGN KEY FOREIGN KEY (file_upload_id) REFERENCES file_uploads(id)
page_history_spec_files_file_upload_id_not_null n NOT NULL file_upload_id
page_history_spec_files_id_not_null n NOT NULL id
page_history_spec_files_page_history_id_fkey FOREIGN KEY FOREIGN KEY (page_history_id) REFERENCES page_history(id)
page_history_spec_files_page_history_id_not_null n NOT NULL page_history_id
page_history_spec_files_pkey PRIMARY KEY PRIMARY KEY (id)
page_history_spec_files_updated_at_not_null n NOT NULL updated_at

Indexes

Name Definition
idx_page_history_spec_files_file_upload CREATE INDEX idx_page_history_spec_files_file_upload ON public.page_history_spec_files USING btree (file_upload_id) WHERE (deleted_at IS NULL)
page_history_spec_files_pkey CREATE UNIQUE INDEX page_history_spec_files_pkey ON public.page_history_spec_files USING btree (id)

Triggers

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

Relations

er

Generated by tbls