Index

public.chatbot_page_sync_statuses

Description

Tells the status of whether the content of a page has been synchronized with the chatbot backend.

Columns

Name Type Default Nullable Children Parents Comment
course_id uuid false public.courses The course this chatbot is appearing on
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.
error_message varchar(1024) true If the synchronization failed, this field contains the error message. If there is no error, the field is null.
id uuid uuid_generate_v4() false A unique, stable identifier for the record.
page_id uuid false public.pages The page that has been synchronized with the chatbot backend.
synced_page_revision_id uuid true public.page_history If null, the page has not been synchronized. If not null, the page has been synchronized with the chatbot backend. The value is the id of the page revision that was succesfully synchronized. The history table is used to check for newer revisions and to sync them.
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
chatbot_page_sync_statuses_course_id_fkey FOREIGN KEY FOREIGN KEY (course_id) REFERENCES courses(id)
chatbot_page_sync_statuses_one_status_per_page UNIQUE UNIQUE NULLS NOT DISTINCT (page_id, deleted_at)
chatbot_page_sync_statuses_page_id_fkey FOREIGN KEY FOREIGN KEY (page_id) REFERENCES pages(id)
chatbot_page_sync_statuses_pkey PRIMARY KEY PRIMARY KEY (id)
chatbot_page_sync_statuses_synced_page_revision_id_fkey FOREIGN KEY FOREIGN KEY (synced_page_revision_id) REFERENCES page_history(id)

Indexes

Name Definition
chatbot_page_sync_statuses_one_status_per_page CREATE UNIQUE INDEX chatbot_page_sync_statuses_one_status_per_page ON public.chatbot_page_sync_statuses USING btree (page_id, deleted_at) NULLS NOT DISTINCT
chatbot_page_sync_statuses_pkey CREATE UNIQUE INDEX chatbot_page_sync_statuses_pkey ON public.chatbot_page_sync_statuses USING btree (id)

Triggers

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

Relations

er

Generated by tbls