From 617de0e077aef0f774bd917ce0668e6450c800df Mon Sep 17 00:00:00 2001 From: Ant Zucaro Date: Sat, 30 Sep 2017 10:21:08 -0400 Subject: [PATCH] Initial version of the player_game_frag_matrix table. --- tables/player_game_frag_matrix.tab | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 tables/player_game_frag_matrix.tab 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; -- 2.39.2