calendar

0 rows


Description

A named calendar (e.g. “Thai Public Holidays”). Groups calendar_event rows.

Columns

Column Type Size Nulls Auto Default Children Parents Comments
id int4 10 null
calendar_event.calendar_id calendar_event_calendar_id_fkey C
calendar_source.calendar_id calendar_source_calendar_id_fkey C
code citext 2147483647 null
name text 2147483647 null
calendar_type text 2147483647 'holiday'::text

holiday | special_event | season | other.

color text 2147483647 null

Hex color for UI display (e.g. #ff0000).

is_public_holiday bool 1 false

Events in this calendar count as public holidays (used by fn_is_holiday).

remark text 2147483647 null
enabled bool 1 true

Indexes

Constraint Name Type Sort Column(s)
calendar_pkey Primary key Asc id
calendar_code_unq Must be unique Asc code

Check Constraints

Constraint Name Constraint
calendar_name_not_blank (btrim(name) <> ''::text)
calendar_type_chk (calendar_type = ANY (ARRAY['holiday'::text, 'special_event'::text, 'season'::text, 'other'::text]))

Relationships