Skip to content

public.game

Description

Columns

Name Type Default Nullable Children Parents Comment
id uuid false public.match_player public.payment_intent public.slot public.cancellation Unique identifier of the match.(DC2Type:uuid)
court_id uuid false public.court Court on which the match is scheduled.(DC2Type:uuid)
club_id uuid false public.club Club that owns the court and hosts the match.(DC2Type:uuid)
coach_id uuid true public.match_coach Optional attached coaching configuration for this match.(DC2Type:uuid)
kind varchar(255) false Visibility of the match: 'PRIVATE' (no public listing) or 'OPEN' (publicly listed).
phase varchar(255) false Lifecycle phase of the match (e.g. SETUP, CONFIRMING, SCHEDULED, RUNNING, FINISHED, TERMINATED, CANCELLED, ABANDONED).
match_period_starts_at timestamp(0) with time zone false Start date and time of the time period.(DC2Type:datetimetz_immutable)
match_period_ends_at timestamp(0) with time zone false End date and time of the time period.(DC2Type:datetimetz_immutable)
court_fee_amount bigint false
court_fee_currency character(3) false (DC2Type:currency)
created_at timestamp(0) with time zone '2013-01-01 13:37:00+00'::timestamp with time zone false The date and time when the match was created.(DC2Type:datetimetz_immutable)
cancelled_at timestamp(0) with time zone NULL::timestamp with time zone true The date and time the match has been cancelled.(DC2Type:datetimetz_immutable)
scheduled_at timestamp(0) with time zone NULL::timestamp with time zone true The date and time the match has been scheduled to be played.(DC2Type:datetimetz_immutable)
terminated_at timestamp(0) with time zone NULL::timestamp with time zone true The date and time the match was terminated by the system.(DC2Type:datetimetz_immutable)
cancelled_by_id uuid true public.user User who cancelled the match (if any).(DC2Type:uuid)
note text true Free-form internal note about the match.
schedule_till_latest timestamp(0) with time zone NULL::timestamp with time zone true The deadline until the match has to be scheduled, otherwise it is automatically terminated.(DC2Type:datetimetz_immutable)
match_period_duration_in_seconds integer false Duration in seconds between startsAt and endsAt.
day_index integer false Day-of-week index of the scheduled start (0=Sunday … 6=Saturday), derived for fast queries.
day_name varchar(255) NULL::character varying false Localized day-of-week name of the scheduled start (e.g., Monday).
running_at timestamp(0) with time zone NULL::timestamp with time zone true The date and time the match actually started (entered RUNNING).(DC2Type:datetimetz_immutable)
finished_at timestamp(0) with time zone NULL::timestamp with time zone true The date and time the match finished (entered FINISHED).(DC2Type:datetimetz_immutable)
confirming_at timestamp(0) with time zone NULL::timestamp with time zone true The date and time the match has entered the confirming phase.(DC2Type:datetimetz_immutable)
match_series_id uuid true public.match_series If set, references the match series (subscription) this match belongs to.(DC2Type:uuid)
created_by_id uuid true public.user User who originally created the match.(DC2Type:uuid)
split_payment_id uuid true public.split_payment Split-payment configuration attached to this match.(DC2Type:uuid)
version integer false Schema/data version for the match aggregate.
is_split_payment_migrated boolean false false Whether this match has been migrated to the new split-payment model.
abandoned_at timestamp(0) with time zone NULL::timestamp with time zone true The date and time the match was automatically abandoned (left in setup without activity).(DC2Type:datetimetz_immutable)
reserved_at timestamp(0) with time zone NULL::timestamp with time zone true (DC2Type:datetimetz_immutable)

Constraints

Name Type Definition
fk_232b318c61190a32 FOREIGN KEY FOREIGN KEY (club_id) REFERENCES club(id)
fk_232b318ce3184009 FOREIGN KEY FOREIGN KEY (court_id) REFERENCES court(id)
game_pkey PRIMARY KEY PRIMARY KEY (id)
fk_232b318c3c105691 FOREIGN KEY FOREIGN KEY (coach_id) REFERENCES match_coach(id)
fk_232b318c187b2d12 FOREIGN KEY FOREIGN KEY (cancelled_by_id) REFERENCES "user"(id)
fk_232b318cb03a8386 FOREIGN KEY FOREIGN KEY (created_by_id) REFERENCES "user"(id)
fk_232b318c4bc97d37 FOREIGN KEY FOREIGN KEY (match_series_id) REFERENCES match_series(id)
fk_232b318c18440004 FOREIGN KEY FOREIGN KEY (split_payment_id) REFERENCES split_payment(id)

Indexes

Name Definition
game_pkey CREATE UNIQUE INDEX game_pkey ON public.game USING btree (id)
idx_232b318c187b2d12 CREATE INDEX idx_232b318c187b2d12 ON public.game USING btree (cancelled_by_id)
idx_232b318c61190a32 CREATE INDEX idx_232b318c61190a32 ON public.game USING btree (club_id)
idx_232b318ce3184009 CREATE INDEX idx_232b318ce3184009 ON public.game USING btree (court_id)
uniq_232b318c3c105691 CREATE UNIQUE INDEX uniq_232b318c3c105691 ON public.game USING btree (coach_id)
idx_232b318c4bc97d37 CREATE INDEX idx_232b318c4bc97d37 ON public.game USING btree (match_series_id)
idx_232b318cb03a8386 CREATE INDEX idx_232b318cb03a8386 ON public.game USING btree (created_by_id)
uniq_232b318c18440004 CREATE UNIQUE INDEX uniq_232b318c18440004 ON public.game USING btree (split_payment_id)

Relations

er


Generated by tbls