A player as a match recorder knows them, in the recorder’s own list. Soft-deleted: a deleted ghost player stays in the matches it played, but is no longer listed, suggested or usable in new matches and claim requests. Invariant (application): deleting a ghost player revokes its active claim edges.
| Name |
Type |
Default |
Nullable |
Children |
Parents |
Comment |
| id |
bigint |
nextval(‘ghost_player_seq’::regclass) |
false |
public.match_participant public.claim_request_target public.claim_edge |
|
|
| public_id |
uuid |
gen_random_uuid() |
false |
|
|
|
| owner_user_id |
bigint |
|
false |
|
public.app_user |
|
| display_name |
varchar(100) |
|
false |
|
|
|
| is_self |
boolean |
false |
false |
|
|
The ghost player that represents the owner themselves in the matches they record. Created with the user, with a claim edge to their own canonical player; never deleted and never unclaimed. |
| 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_ghost_player_self_not_deleted |
CHECK |
CHECK ((NOT (is_self AND (deleted_at IS NOT NULL)))) |
| fk_ghost_player_owner_user_id |
FOREIGN KEY |
FOREIGN KEY (owner_user_id) REFERENCES app_user(id) |
| ghost_player_pkey |
PRIMARY KEY |
PRIMARY KEY (id) |
| uq_ghost_player_public_id |
UNIQUE |
UNIQUE (public_id) |
| Name |
Definition |
| ghost_player_pkey |
CREATE UNIQUE INDEX ghost_player_pkey ON public.ghost_player USING btree (id) |
| uq_ghost_player_public_id |
CREATE UNIQUE INDEX uq_ghost_player_public_id ON public.ghost_player USING btree (public_id) |
| ix_ghost_player_owner_user_id |
CREATE INDEX ix_ghost_player_owner_user_id ON public.ghost_player USING btree (owner_user_id) |
| uq_ghost_player_owner_user_id_self |
CREATE UNIQUE INDEX uq_ghost_player_owner_user_id_self ON public.ghost_player USING btree (owner_user_id) WHERE is_self |

Generated by tbls