]> git.rm.cloudns.org Git - xonotic/xonstatdb.git/commitdiff
Add a new table for player skills.
authorAnt Zucaro <azucaro@gmail.com>
Sun, 17 Jan 2021 19:33:29 +0000 (14:33 -0500)
committerAnt Zucaro <azucaro@gmail.com>
Sun, 17 Jan 2021 19:33:29 +0000 (14:33 -0500)
build/build_full.sql
tables/player_skills.tab [new file with mode: 0644]

index a9072c4dbdb72ee21eae8d6b323cdc1df0f9436c..d74adfccc4a62a797598e225025be0dec6c8b8cf 100755 (executable)
@@ -1,4 +1,5 @@
 -- drop tables first in reverse order
+drop table if exists player_skills;
 drop table if exists player_game_nonparticipants;
 drop table if exists player_game_frag_matrix;
 drop table if exists player_agg_stats_mv;
@@ -71,6 +72,7 @@ drop table if exists players cascade;
 \i tables/player_agg_stats_mv.tab
 \i tables/player_game_frag_matrix.tab
 \i tables/player_game_nonparticipants.tab
+\i tables/player_skills.tab
 
 begin;
 
diff --git a/tables/player_skills.tab b/tables/player_skills.tab
new file mode 100644 (file)
index 0000000..45d9f87
--- /dev/null
@@ -0,0 +1,21 @@
+CREATE TABLE xonstat.player_skills
+(
+  player_id integer NOT NULL,
+  game_type_cd character varying(10) NOT NULL,
+  mu numeric NOT NULL,
+  sigma numeric NOT NULL,
+  active_ind boolean NOT NULL default true,
+  create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'),
+  update_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'),
+  CONSTRAINT player_skills_pk PRIMARY KEY (player_id, game_type_cd),
+  CONSTRAINT player_skills_fk01 FOREIGN KEY (player_id)
+      REFERENCES xonstat.players (player_id) MATCH SIMPLE
+      ON UPDATE NO ACTION ON DELETE NO ACTION,
+  CONSTRAINT player_skills_fk02 FOREIGN KEY (game_type_cd)
+      REFERENCES xonstat.cd_game_type (game_type_cd) MATCH SIMPLE
+      ON UPDATE NO ACTION ON DELETE NO ACTION
+)
+WITH (
+  OIDS=FALSE
+);
+ALTER TABLE xonstat.player_skills OWNER TO xonstat;