]> git.rm.cloudns.org Git - xonotic/xonstatdb.git/commitdiff
Initial version of the player_game_frag_matrix table.
authorAnt Zucaro <azucaro@gmail.com>
Sat, 30 Sep 2017 14:21:08 +0000 (10:21 -0400)
committerAnt Zucaro <azucaro@gmail.com>
Sat, 30 Sep 2017 14:21:08 +0000 (10:21 -0400)
tables/player_game_frag_matrix.tab [new file with mode: 0755]

diff --git a/tables/player_game_frag_matrix.tab b/tables/player_game_frag_matrix.tab
new file mode 100755 (executable)
index 0000000..e7fd157
--- /dev/null
@@ -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;