Index

public.url_redirections

Description

A url redirection is typically created when a page is moved. The redirection will be used to redirect old links to the new location. If there’s a conflict with a page url and a redirection, the page will win the conflict.

Columns

Name Type Default Nullable Children Parents Comment
course_id uuid false public.courses Course where the redirection is valid. A redirection only works within one course.
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.
destination_page_id uuid false public.pages Which page the redirection will redirect to.
id uuid uuid_generate_v4() false A unique, stable identifier for the record.
old_url_path text false Url path where the page was previously available.
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
old_url_pathold_url_path_uniqueness UNIQUE UNIQUE NULLS NOT DISTINCT (course_id, old_url_path, deleted_at)
url_redirections_course_id_fkey FOREIGN KEY FOREIGN KEY (course_id) REFERENCES courses(id)
url_redirections_destination_page_id_fkey FOREIGN KEY FOREIGN KEY (destination_page_id) REFERENCES pages(id)
url_redirections_pkey PRIMARY KEY PRIMARY KEY (id)

Indexes

Name Definition
old_url_pathold_url_path_uniqueness CREATE UNIQUE INDEX old_url_pathold_url_path_uniqueness ON public.url_redirections USING btree (course_id, old_url_path, deleted_at) NULLS NOT DISTINCT
url_redirections_pkey CREATE UNIQUE INDEX url_redirections_pkey ON public.url_redirections USING btree (id)

Triggers

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

Relations

er

Generated by tbls