-- drop tables first in reverse order
+drop table if exists player_game_anticheats;
drop table if exists team_game_stats;
drop table if exists summary_stats cascade;
drop table if exists player_map_captimes;
\i tables/player_map_captimes.tab
\i tables/summary_stats.tab
\i tables/team_game_stats.tab
+\i tables/player_game_anticheats.tab
begin;
--- /dev/null
+begin;
+ -- get rid of stuff that is older than 30 days old
+ delete from player_game_anticheats
+ where create_dt < now() at time zone 'utc' - interval '30 days';
+end;
--- /dev/null
+CREATE TABLE xonstat.player_game_anticheats\r
+(\r
+ player_game_anticheat_id bigserial NOT NULL,\r
+ player_id integer NOT NULL,\r
+ game_id bigint NOT NULL,\r
+ key character varying(128),\r
+ value numeric,\r
+ create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'),\r
+ CONSTRAINT player_game_anticheats_pk PRIMARY KEY (player_game_anticheat_id),\r
+ CONSTRAINT player_game_anticheats_fk01 FOREIGN KEY (player_id)\r
+ REFERENCES players (player_id) MATCH SIMPLE\r
+ ON UPDATE NO ACTION ON DELETE NO ACTION\r
+)\r
+WITH (\r
+ OIDS=FALSE\r
+);\r
+\r
+CREATE INDEX player_game_anticheats_ix01 on player_game_anticheats(game_id);\r
+CREATE INDEX player_game_anticheats_ix02 on player_game_anticheats(player_id);\r
+ALTER TABLE xonstat.player_game_anticheats OWNER TO xonstat;\r