Index

public.page_history

Description

Contains all past and current revisions of each page’s content.

Columns

Name Type Default Nullable Children Parents Comment
author_user_id uuid false public.users The id of the user that made the change.
content jsonb false The unnormalized content of the page after the edit.
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.
history_change_reason history_change_reason false The reason the page’s content changed
id uuid uuid_generate_v4() false public.page_history A unique, stable identifier for the record.
page_id uuid false public.pages The page that this revision is of.
restored_from_id uuid true public.page_history If the page was restored from an earlier revision, contains the id of that revision.
title varchar(255) false The title of the page after the edit.
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_author_user_id_fkey FOREIGN KEY FOREIGN KEY (author_user_id) REFERENCES users(id)
page_history_page_id_fkey FOREIGN KEY FOREIGN KEY (page_id) REFERENCES pages(id)
page_history_pkey PRIMARY KEY PRIMARY KEY (id)
page_history_restored_from_id_fkey FOREIGN KEY FOREIGN KEY (restored_from_id) REFERENCES page_history(id)

Indexes

Name Definition
page_history_pkey CREATE UNIQUE INDEX page_history_pkey ON public.page_history USING btree (id)

Relations

er

Generated by tbls