Index

public.organizations

Description

A unit that organizes and manages courses e.g. University of Helsinki, Department of Computer Science.

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.
description varchar(1000) true Organization description.
hidden boolean false false
id uuid uuid_generate_v4() false public.courses public.exams public.roles A unique, stable identifier for the record.
name varchar(255) false Human readable name of the organization e.g. “University of Helsinki, Department of Computer Science”.
organization_image_path varchar(255) true Organization image path is converted to organization image url once fetched from database.
slug varchar(255) “substring”(md5((random())::text), 0, 15) false A unique abbreviation of the organization name that is visible in URLs e.g. “uh-cs”.
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
organizations_pkey PRIMARY KEY PRIMARY KEY (id)
organizations_slug_key UNIQUE UNIQUE (slug)

Indexes

Name Definition
organizations_pkey CREATE UNIQUE INDEX organizations_pkey ON public.organizations USING btree (id)
organizations_slug_key CREATE UNIQUE INDEX organizations_slug_key ON public.organizations USING btree (slug)

Triggers

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

Relations

er

Generated by tbls