Skip to content

match_participant

A player’s result in a match. Removed from a DRAFT match by deleting the row (and its loadout); soft-deleted only together with its match. Invariant (application): a dispute is raised by a user whose canonical player has an active claim edge to the participant’s ghost player.

Name Type Default Nullable Children Parents Comment
id bigint nextval(‘match_participant_seq’::regclass) false public.match_edit_participant_change public.match_edit_loadout_change
public_id uuid gen_random_uuid() false
match_id bigint false public.match
ghost_player_id bigint false public.ghost_player
loadout_id bigint true public.match_loadout
score numeric(10,2) true
rank integer true
outcome varchar(16) true
dispute_reason varchar(1000) true Why the claimed player disagrees with this result. Cleared when the dispute is withdrawn or when an approved match edit changes this participant.
disputed_at timestamp with time zone true
disputed_by_user_id bigint true public.app_user
created_at timestamp with time zone now() false
updated_at timestamp with time zone true
deleted_at timestamp with time zone true
version bigint false
Name Type Definition
chk_match_participant_dispute CHECK CHECK ((((dispute_reason IS NULL) AND (disputed_at IS NULL) AND (disputed_by_user_id IS NULL)) OR ((dispute_reason IS NOT NULL) AND (disputed_at IS NOT NULL) AND (disputed_by_user_id IS NOT NULL))))
chk_match_participant_outcome CHECK CHECK (((outcome IS NULL) OR ((outcome)::text = ANY ((ARRAY[‘WIN’::character varying, ‘LOSS’::character varying])::text[]))))
chk_match_participant_rank CHECK CHECK (((rank IS NULL) OR (rank >= 1)))
fk_match_participant_disputed_by_user_id FOREIGN KEY FOREIGN KEY (disputed_by_user_id) REFERENCES app_user(id)
fk_match_participant_ghost_player_id FOREIGN KEY FOREIGN KEY (ghost_player_id) REFERENCES ghost_player(id)
fk_match_participant_match_id FOREIGN KEY FOREIGN KEY (match_id) REFERENCES match(id)
fk_match_participant_loadout_id FOREIGN KEY FOREIGN KEY (loadout_id) REFERENCES match_loadout(id)
match_participant_pkey PRIMARY KEY PRIMARY KEY (id)
uq_match_participant_public_id UNIQUE UNIQUE (public_id)
uq_match_participant_match_id_ghost_player_id UNIQUE UNIQUE (match_id, ghost_player_id)
uq_match_participant_loadout_id UNIQUE UNIQUE (loadout_id)
Name Definition
match_participant_pkey CREATE UNIQUE INDEX match_participant_pkey ON public.match_participant USING btree (id)
uq_match_participant_public_id CREATE UNIQUE INDEX uq_match_participant_public_id ON public.match_participant USING btree (public_id)
uq_match_participant_match_id_ghost_player_id CREATE UNIQUE INDEX uq_match_participant_match_id_ghost_player_id ON public.match_participant USING btree (match_id, ghost_player_id)
uq_match_participant_loadout_id CREATE UNIQUE INDEX uq_match_participant_loadout_id ON public.match_participant USING btree (loadout_id)
ix_match_participant_ghost_player_id CREATE INDEX ix_match_participant_ghost_player_id ON public.match_participant USING btree (ghost_player_id)
ix_match_participant_disputed_by_user_id CREATE INDEX ix_match_participant_disputed_by_user_id ON public.match_participant USING btree (disputed_by_user_id)

ER diagram


Generated by tbls