]> de.git.xonotic.org Git - xonotic/xonstatdb.git/blob - tables/player_game_frag_matrix.tab
e7fd157fabb16451623f0e739ec8be67bc54d9e9
[xonotic/xonstatdb.git] / tables / player_game_frag_matrix.tab
1 CREATE TABLE xonstat.player_game_frag_matrix
2 (
3   game_id bigint NOT NULL,
4   player_game_stat_id bigint NOT NULL,
5   player_id integer NOT NULL,
6   player_index smallint NOT NULL,
7   matrix jsonb NOT NULL,
8   create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'),
9   CONSTRAINT player_game_frag_matrix_pk PRIMARY KEY (game_id, player_game_stat_id),
10   CONSTRAINT player_game_frag_matrix_fk001 FOREIGN KEY (game_id)
11       REFERENCES xonstat.games (game_id) MATCH SIMPLE
12       ON UPDATE NO ACTION ON DELETE NO ACTION,
13   CONSTRAINT player_game_frag_matrix_fk002 FOREIGN KEY (player_game_stat_id)
14       REFERENCES xonstat.player_game_stats (player_game_stat_id) MATCH SIMPLE
15       ON UPDATE NO ACTION ON DELETE NO ACTION,
16   CONSTRAINT player_game_frag_matrix_fk003 FOREIGN KEY (player_id)
17       REFERENCES xonstat.players (player_id) MATCH SIMPLE
18       ON UPDATE NO ACTION ON DELETE NO ACTION
19 )
20 WITH (
21   OIDS=FALSE
22 );
23
24 -- TODO: determine if this is needed. Assume no for now.
25 -- CREATE INDEX player_game_frag_matrix_ix01 on player_game_frag_matrix(game_id);
26
27 ALTER TABLE xonstat.player_game_frag_matrix OWNER TO xonstat;