--- /dev/null
+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;