From: Ant Zucaro Date: Sat, 30 Sep 2017 14:21:08 +0000 (-0400) Subject: Initial version of the player_game_frag_matrix table. X-Git-Url: http://git.xonotic.org/?a=commitdiff_plain;h=617de0e077aef0f774bd917ce0668e6450c800df;p=xonotic%2Fxonstatdb.git Initial version of the player_game_frag_matrix table. --- diff --git a/tables/player_game_frag_matrix.tab b/tables/player_game_frag_matrix.tab new file mode 100755 index 0000000..e7fd157 --- /dev/null +++ b/tables/player_game_frag_matrix.tab @@ -0,0 +1,27 @@ +CREATE TABLE xonstat.player_game_frag_matrix +( + game_id bigint NOT NULL, + player_game_stat_id bigint NOT NULL, + player_id integer NOT NULL, + player_index smallint NOT NULL, + matrix jsonb NOT NULL, + create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'), + CONSTRAINT player_game_frag_matrix_pk PRIMARY KEY (game_id, player_game_stat_id), + CONSTRAINT player_game_frag_matrix_fk001 FOREIGN KEY (game_id) + REFERENCES xonstat.games (game_id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION, + CONSTRAINT player_game_frag_matrix_fk002 FOREIGN KEY (player_game_stat_id) + REFERENCES xonstat.player_game_stats (player_game_stat_id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION, + CONSTRAINT player_game_frag_matrix_fk003 FOREIGN KEY (player_id) + REFERENCES xonstat.players (player_id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION +) +WITH ( + OIDS=FALSE +); + +-- TODO: determine if this is needed. Assume no for now. +-- CREATE INDEX player_game_frag_matrix_ix01 on player_game_frag_matrix(game_id); + +ALTER TABLE xonstat.player_game_frag_matrix OWNER TO xonstat;