From 749ac09040c174680be1abeab2ecca0064f5b525 Mon Sep 17 00:00:00 2001 From: Ant Zucaro Date: Mon, 27 May 2024 14:34:45 -0400 Subject: [PATCH] Remove original changeset files (now consolidated with goose). --- build/build_full.sql | 242 ---------- migrations/00001_base.sql | 21 +- scripts/update_summary_stats.sql | 30 -- tables/achievements.tab | 18 - tables/active_maps_mv.tab | 10 - tables/active_players_mv.tab | 10 - tables/active_servers_mv.tab | 10 - tables/cd_achievement.tab | 13 - tables/cd_game_type.tab | 11 - tables/cd_ladder.tab | 15 - tables/cd_mutator.tab | 12 - tables/cd_weapon.tab | 11 - tables/db_version.tab | 11 - tables/game_mutators.tab | 16 - tables/games.tab | 323 ------------- tables/hashkeys.tab | 16 - tables/map_game_types.tab | 16 - tables/maps.tab | 14 - tables/merged_servers.tab | 13 - tables/player_agg_stats_mv.tab | 26 -- tables/player_elos.tab | 22 - tables/player_game_anticheats.tab | 20 - tables/player_game_frag_matrix.tab | 246 ---------- tables/player_game_nonparticipants.tab | 196 -------- tables/player_game_stats.tab | 434 ------------------ tables/player_groups.tab | 14 - tables/player_ladder_ranks.tab | 24 - tables/player_map_captimes.tab | 29 -- tables/player_medals.tab | 17 - tables/player_nicks.tab | 15 - tables/player_ranks.tab | 21 - tables/player_ranks_history.tab | 14 - tables/player_skills.tab | 21 - tables/player_weapon_stats.tab | 422 ----------------- tables/players.tab | 15 - tables/servers.tab | 22 - tables/summary_stats.tab | 17 - tables/summary_stats_mv.tab | 10 - tables/team_game_stats.tab | 358 --------------- triggers/games_ins_trg.sql | 64 --- triggers/player_game_frag_matrix_ins_trg.sql | 63 --- .../player_game_nonparticipants_ins_trg.sql | 63 --- triggers/player_game_stats_ins_trg.sql | 63 --- triggers/player_weapon_stats_ins_trg.sql | 63 --- triggers/team_game_stats_ins_trg.sql | 63 --- 45 files changed, 8 insertions(+), 3126 deletions(-) delete mode 100755 build/build_full.sql delete mode 100644 scripts/update_summary_stats.sql delete mode 100755 tables/achievements.tab delete mode 100755 tables/active_maps_mv.tab delete mode 100755 tables/active_players_mv.tab delete mode 100755 tables/active_servers_mv.tab delete mode 100755 tables/cd_achievement.tab delete mode 100755 tables/cd_game_type.tab delete mode 100755 tables/cd_ladder.tab delete mode 100755 tables/cd_mutator.tab delete mode 100755 tables/cd_weapon.tab delete mode 100755 tables/db_version.tab delete mode 100755 tables/game_mutators.tab delete mode 100755 tables/games.tab delete mode 100755 tables/hashkeys.tab delete mode 100755 tables/map_game_types.tab delete mode 100755 tables/maps.tab delete mode 100755 tables/merged_servers.tab delete mode 100755 tables/player_agg_stats_mv.tab delete mode 100755 tables/player_elos.tab delete mode 100755 tables/player_game_anticheats.tab delete mode 100755 tables/player_game_frag_matrix.tab delete mode 100755 tables/player_game_nonparticipants.tab delete mode 100755 tables/player_game_stats.tab delete mode 100755 tables/player_groups.tab delete mode 100755 tables/player_ladder_ranks.tab delete mode 100755 tables/player_map_captimes.tab delete mode 100755 tables/player_medals.tab delete mode 100755 tables/player_nicks.tab delete mode 100755 tables/player_ranks.tab delete mode 100755 tables/player_ranks_history.tab delete mode 100644 tables/player_skills.tab delete mode 100755 tables/player_weapon_stats.tab delete mode 100755 tables/players.tab delete mode 100755 tables/servers.tab delete mode 100755 tables/summary_stats.tab delete mode 100755 tables/summary_stats_mv.tab delete mode 100755 tables/team_game_stats.tab delete mode 100644 triggers/games_ins_trg.sql delete mode 100644 triggers/player_game_frag_matrix_ins_trg.sql delete mode 100644 triggers/player_game_nonparticipants_ins_trg.sql delete mode 100644 triggers/player_game_stats_ins_trg.sql delete mode 100644 triggers/player_weapon_stats_ins_trg.sql delete mode 100644 triggers/team_game_stats_ins_trg.sql diff --git a/build/build_full.sql b/build/build_full.sql deleted file mode 100755 index e88359e..0000000 --- a/build/build_full.sql +++ /dev/null @@ -1,242 +0,0 @@ --- 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; -drop table if exists merged_servers; -drop table if exists player_medals; -drop table if exists active_maps_mv; -drop table if exists active_servers_mv; -drop table if exists active_players_mv; -drop table if exists summary_stats_mv; -drop table if exists player_groups; -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; -drop table if exists player_ladder_ranks; -drop table if exists cd_ladder cascade; -drop table if exists player_ranks_history cascade; -drop table if exists player_ranks cascade; -drop table if exists player_elos cascade; -drop table if exists player_nicks cascade; -drop table if exists db_version cascade; -drop table if exists hashkeys cascade; -drop table if exists player_weapon_stats cascade; -drop table if exists achievements cascade; -drop table if exists cd_achievement cascade; ---drop table if exists game_mutators cascade; -drop table if exists player_game_stats cascade; -drop table if exists games cascade; ---drop table if exists map_game_types cascade; -drop table if exists maps cascade; -drop table if exists servers cascade; -drop table if exists cd_game_type cascade; -drop table if exists cd_weapon cascade; ---drop table if exists cd_mutator cascade; -drop table if exists players cascade; - --- table definitions -\i tables/players.tab ---\i tables/cd_mutator.tab -\i tables/cd_game_type.tab -\i tables/cd_weapon.tab -\i tables/servers.tab -\i tables/maps.tab ---\i tables/map_game_types.tab -\i tables/games.tab -\i tables/player_game_stats.tab ---\i tables/game_mutators.tab -\i tables/cd_achievement.tab -\i tables/achievements.tab -\i tables/player_weapon_stats.tab -\i tables/hashkeys.tab -\i tables/db_version.tab -\i tables/player_nicks.tab -\i tables/player_elos.tab -\i tables/player_ranks.tab -\i tables/player_ranks_history.tab -\i tables/cd_ladder.tab -\i tables/player_ladder_ranks.tab -\i tables/player_map_captimes.tab -\i tables/summary_stats.tab -\i tables/team_game_stats.tab -\i tables/player_game_anticheats.tab -\i tables/player_groups.tab -\i tables/summary_stats_mv.tab -\i tables/active_players_mv.tab -\i tables/active_servers_mv.tab -\i tables/active_maps_mv.tab -\i tables/player_medals.tab -\i tables/merged_servers.tab -\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; - --- game types -insert into cd_game_type(game_type_cd, descr) -values('arena', 'Arena'); -insert into cd_game_type(game_type_cd, descr) -values('as', 'Assault'); -insert into cd_game_type(game_type_cd, descr) -values('ctf', 'Capture The Flag'); -insert into cd_game_type(game_type_cd, descr) -values('ca', 'Clan Arena'); -insert into cd_game_type(game_type_cd, descr) -values('dm', 'Deathmatch'); -insert into cd_game_type(game_type_cd, descr) -values('dom', 'Domination'); -insert into cd_game_type(game_type_cd, descr) -values('ft', 'Freezetag'); -insert into cd_game_type(game_type_cd, descr) -values('ka', 'Keepaway'); -insert into cd_game_type(game_type_cd, descr) -values('tka', 'Team Keepaway'); -insert into cd_game_type(game_type_cd, descr) -values('kh', 'Keyhunt'); -insert into cd_game_type(game_type_cd, descr) -values('lms', 'Last Man Standing'); -insert into cd_game_type(game_type_cd, descr) -values('nb', 'Nexball'); -insert into cd_game_type(game_type_cd, descr) -values('ons', 'Onslaught'); -insert into cd_game_type(game_type_cd, descr) -values('rc', 'Race'); -insert into cd_game_type(game_type_cd, descr) -values('cts', 'Complete This Stage'); -insert into cd_game_type(game_type_cd, descr) -values('rune', 'Runematch'); -insert into cd_game_type(game_type_cd, descr) -values('tdm', 'Team Deathmatch'); -insert into cd_game_type(game_type_cd, descr) -values('duel', 'Duel'); -insert into cd_game_type(game_type_cd, descr) -values('mayhem', 'Mayhem'); -insert into cd_game_type(game_type_cd, descr) -values('tmayhem', 'Team Mayhem'); - --- weapons -insert into cd_weapon(weapon_cd, descr) values('laser', 'Laser'); -insert into cd_weapon(weapon_cd, descr) values('shotgun', 'Shotgun'); -insert into cd_weapon(weapon_cd, descr) values('uzi', 'Machine Gun'); -insert into cd_weapon(weapon_cd, descr) values('grenadelauncher', 'Mortar'); -insert into cd_weapon(weapon_cd, descr) values('electro', 'Electro'); -insert into cd_weapon(weapon_cd, descr) values('crylink', 'Crylink'); -insert into cd_weapon(weapon_cd, descr) values('nex', 'Nex'); -insert into cd_weapon(weapon_cd, descr) values('hagar', 'Hagar'); -insert into cd_weapon(weapon_cd, descr) values('rocketlauncher', 'Rocket Launcher'); -insert into cd_weapon(weapon_cd, descr) values('minstanex', 'MinstaNex'); -insert into cd_weapon(weapon_cd, descr) values('rifle', 'Camping Rifle'); -insert into cd_weapon(weapon_cd, descr) values('fireball', 'Fireball'); -insert into cd_weapon(weapon_cd, descr) values('minelayer', 'Minelayer'); -insert into cd_weapon(weapon_cd, descr) values('seeker', 'T.A.G. Seeker'); -insert into cd_weapon(weapon_cd, descr) values('tuba', '@!#%''n Tuba'); -insert into cd_weapon(weapon_cd, descr) values('hlac', 'Heavy Laser Assault Cannon'); -insert into cd_weapon(weapon_cd, descr) values('hook', 'Grappling Hook'); -insert into cd_weapon(weapon_cd, descr) values('porto', 'Port-O-Launch'); -insert into cd_weapon(weapon_cd, descr) values('blaster', 'Blaster'); -insert into cd_weapon(weapon_cd, descr) values('devastator', 'Devastator'); -insert into cd_weapon(weapon_cd, descr) values('machinegun', 'Machine Gun'); -insert into cd_weapon(weapon_cd, descr) values('mortar', 'Mortar'); -insert into cd_weapon(weapon_cd, descr) values('vaporizer', 'Vaporizer'); -insert into cd_weapon(weapon_cd, descr) values('vortex', 'Vortex'); -insert into cd_weapon(weapon_cd, descr) values('arc', 'Arc'); -insert into cd_weapon(weapon_cd, descr) values('okhmg', 'Overkill Heavy Machine Gun'); -insert into cd_weapon(weapon_cd, descr) values('oknex', 'Overkill Nex'); -insert into cd_weapon(weapon_cd, descr) values('okshotgun', 'Overkill Shotgun'); -insert into cd_weapon(weapon_cd, descr) values('okmachinegun', 'Overkill Machine Gun'); -insert into cd_weapon(weapon_cd, descr) values('okrpc', 'Overkill Rocket-Propelled Chainsaw'); - --- achievements -insert into cd_achievement(achievement_cd, descr, active_ind) -values(1, 'Play a game online.', 'Y'); -insert into cd_achievement(achievement_cd, descr, active_ind) -values(2, 'Play each of the game types.', 'Y'); -insert into cd_achievement(achievement_cd, descr, active_ind) -values(3, 'Register online.', 'Y'); -insert into cd_achievement(achievement_cd, descr, active_ind) -values(4, 'Get higher than 50% nex accuracy in a single game.', 'Y'); -insert into cd_achievement(achievement_cd, descr, active_ind) -values(5, 'Play in 50 games.', 'Y'); -insert into cd_achievement(achievement_cd, descr, active_ind) -values(6, 'Play in 100 games.', 'Y'); -insert into cd_achievement(achievement_cd, descr, active_ind) -values(7, 'Play in 250 games.', 'Y'); -insert into cd_achievement(achievement_cd, descr, active_ind) -values(8, 'Play in 500 games.', 'Y'); -insert into cd_achievement(achievement_cd, descr, active_ind) -values(9, 'Play in 1000 games.', 'Y'); -insert into cd_achievement(achievement_cd, descr, active_ind) -values(10,'Get more than 10 carrier kills in a single game.', 'Y'); -insert into cd_achievement(achievement_cd, descr, active_ind) -values(11,'Get more than 5 captures in a single game.', 'Y'); -insert into cd_achievement(achievement_cd, descr, active_ind) -values(12,'Accumulate 10 hours of play.', 'Y'); -insert into cd_achievement(achievement_cd, descr, active_ind) -values(13,'Accumulate 24 hours of play.', 'Y'); -insert into cd_achievement(achievement_cd, descr, active_ind) -values(14,'Accumulate 48 hours of play.', 'Y'); -insert into cd_achievement(achievement_cd, descr, active_ind) -values(15,'Accumulate 1 week of play.', 'Y'); -insert into cd_achievement(achievement_cd, descr, active_ind) -values(16,'Get more than 5 laser kills in a single game.', 'Y'); -insert into cd_achievement(achievement_cd, descr, active_ind) -values(17,'Get more than 10 laser kills in a single game.', 'Y'); -insert into cd_achievement(achievement_cd, descr, active_ind) -values(18,'Get greater than 25% accuracy with the machine gun in a single game.', 'Y'); -insert into cd_achievement(achievement_cd, descr, active_ind) -values(19,'Get more frags than deaths in a single game.', 'Y'); -insert into cd_achievement(achievement_cd, descr, active_ind) -values(20,'Be the highest scorer in a game.', 'Y'); - --- mutators ---insert into cd_mutator(mutator_cd, name) ---values(1, 'g_dodging'); ---insert into cd_mutator(mutator_cd, name) ---values(2, 'g_minstagib'); ---insert into cd_mutator(mutator_cd, name) ---values(3, 'g_nix'); ---insert into cd_mutator(mutator_cd, name) ---values(4, 'g_rocket_flying'); ---insert into cd_mutator(mutator_cd, name) ---values(5, 'g_weaponarena'); ---insert into cd_mutator(mutator_cd, name) ---values(6, 'g_start_weapon_laser'); ---insert into cd_mutator(mutator_cd, name) ---values(7, 'sv_gravity'); ---insert into cd_mutator(mutator_cd, name) ---values(8, 'g_cloaked'); ---insert into cd_mutator(mutator_cd, name) ---values(9, 'g_grappling_hook'); ---insert into cd_mutator(mutator_cd, name) ---values(10, 'g_midair'); ---insert into cd_mutator(mutator_cd, name) ---values(11, 'g_vampire'); ---insert into cd_mutator(mutator_cd, name) ---values(12, 'g_pinata'); ---insert into cd_mutator(mutator_cd, name) ---values(13, 'g_weapon_stay'); ---insert into cd_mutator(mutator_cd, name) ---values(14, 'g_bloodloss'); ---insert into cd_mutator(mutator_cd, name) ---values(15, 'g_jetpack'); - --- bots and untracked players have special records in player -insert into players (nick) values ('Bot'); -insert into players (nick) values ('Untracked Player'); - --- triggers -\i triggers/games_ins_trg.sql -\i triggers/player_game_stats_ins_trg.sql -\i triggers/player_weapon_stats_ins_trg.sql -\i triggers/team_game_stats_ins_trg.sql -\i triggers/player_game_frag_matrix_ins_trg.sql -\i triggers/player_game_nonparticipants_ins_trg.sql - --- version tracking -insert into db_version(version, descr) values('1.0.0', 'Initial build'); - -commit; diff --git a/migrations/00001_base.sql b/migrations/00001_base.sql index 6d82ed1..d0ecc25 100644 --- a/migrations/00001_base.sql +++ b/migrations/00001_base.sql @@ -1836,20 +1836,16 @@ CREATE INDEX IF NOT EXISTS player_game_anticheats_ix02 on player_game_anticheats ALTER TABLE xonstat.player_game_anticheats OWNER TO xonstat; -- summary_stats_mv -CREATE TABLE IF NOT EXISTS xonstat.summary_stats -( - summary_stats_id bigserial NOT NULL, - total_players bigint NOT NULL, - total_servers bigint NOT NULL, - total_games bigint NOT NULL, - total_dm_games bigint NOT NULL, - total_duel_games bigint NOT NULL, - total_ctf_games bigint NOT NULL, - create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'), - CONSTRAINT summary_stats_pk PRIMARY KEY (summary_stats_id) +CREATE TABLE summary_stats_mv ( + scope character varying(30), + sort_order integer, + num_players integer, + game_type_cd character varying(10), + num_games integer, + create_dt timestamp without time zone default (now() at time zone 'UTC') ); -ALTER TABLE xonstat.summary_stats OWNER TO xonstat; +ALTER TABLE xonstat.summary_stats_mv OWNER TO xonstat; -- active_players_mv CREATE TABLE IF NOT EXISTS active_players_mv( @@ -2941,7 +2937,6 @@ DROP TABLE IF EXISTS active_players_mv CASCADE; DROP TABLE IF EXISTS summary_stats_mv CASCADE; DROP TABLE IF EXISTS player_game_anticheats CASCADE; DROP TABLE IF EXISTS team_game_stats CASCADE; -DROP TABLE IF EXISTS summary_stats CASCADE; DROP TABLE IF EXISTS player_map_captimes CASCADE; DROP TABLE IF EXISTS hashkeys CASCADE; DROP TABLE IF EXISTS player_weapon_stats CASCADE; diff --git a/scripts/update_summary_stats.sql b/scripts/update_summary_stats.sql deleted file mode 100644 index 24c0f70..0000000 --- a/scripts/update_summary_stats.sql +++ /dev/null @@ -1,30 +0,0 @@ -begin transaction; - -- get rid of the existing summary stats since we're about to refresh - delete from summary_stats; - - insert into summary_stats(total_players, total_servers, total_games, - total_dm_games, total_duel_games, total_ctf_games) - with total_games as ( - select game_type_cd, count(*) total_games - from games - where game_type_cd in ('duel', 'dm', 'ctf') - group by game_type_cd - ), - total_players as ( - select count(*) total_players - from players - where active_ind = true - ), - total_servers as ( - select count(*) total_servers - from servers - where active_ind = true - ) - select tp.total_players, ts.total_servers, dm.total_games+duel.total_games+ctf.total_games total_games, - dm.total_games dm_games, duel.total_games duel_games, ctf.total_games ctf_games - from total_games dm, total_games duel, total_games ctf, total_players tp, total_servers ts - where dm.game_type_cd = 'dm' - and ctf.game_type_cd = 'ctf' - and duel.game_type_cd = 'duel'; - -end; diff --git a/tables/achievements.tab b/tables/achievements.tab deleted file mode 100755 index 139e777..0000000 --- a/tables/achievements.tab +++ /dev/null @@ -1,18 +0,0 @@ -CREATE TABLE xonstat.achievements -( - achievement_id serial NOT NULL, - achievement_cd integer NOT NULL, - player_id integer NOT NULL, - create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'), - CONSTRAINT achievements_pk PRIMARY KEY (achievement_id), - CONSTRAINT achievements_fk001 FOREIGN KEY (achievement_cd) - REFERENCES xonstat.cd_achievement (achievement_cd) MATCH SIMPLE - ON UPDATE NO ACTION ON DELETE NO ACTION, - CONSTRAINT achievements_fk002 FOREIGN KEY (player_id) - REFERENCES xonstat.players (player_id) MATCH SIMPLE - ON UPDATE NO ACTION ON DELETE NO ACTION -) -WITH ( - OIDS=FALSE -); -ALTER TABLE xonstat.achievements OWNER TO xonstat; diff --git a/tables/active_maps_mv.tab b/tables/active_maps_mv.tab deleted file mode 100755 index aeaccbc..0000000 --- a/tables/active_maps_mv.tab +++ /dev/null @@ -1,10 +0,0 @@ -create table active_maps_mv( - sort_order integer, - map_id bigint, - map_name character varying(128), - games integer, - create_dt timestamp without time zone default (now() at time zone 'UTC'), - CONSTRAINT active_maps_mv_pk PRIMARY KEY (sort_order) -); - -ALTER TABLE xonstat.active_maps_mv OWNER TO xonstat; diff --git a/tables/active_players_mv.tab b/tables/active_players_mv.tab deleted file mode 100755 index 6d41752..0000000 --- a/tables/active_players_mv.tab +++ /dev/null @@ -1,10 +0,0 @@ -create table active_players_mv( - sort_order integer, - player_id bigint, - nick character varying(128), - alivetime interval, - create_dt timestamp without time zone default (now() at time zone 'UTC'), - CONSTRAINT active_players_mv_pk PRIMARY KEY (sort_order) -); - -ALTER TABLE xonstat.active_players_mv OWNER TO xonstat; diff --git a/tables/active_servers_mv.tab b/tables/active_servers_mv.tab deleted file mode 100755 index 3a5c594..0000000 --- a/tables/active_servers_mv.tab +++ /dev/null @@ -1,10 +0,0 @@ -create table active_servers_mv( - sort_order integer, - server_id bigint, - server_name character varying(128), - play_time interval, - create_dt timestamp without time zone default (now() at time zone 'UTC'), - CONSTRAINT active_servers_mv_pk PRIMARY KEY (sort_order) -); - -ALTER TABLE xonstat.active_servers_mv OWNER TO xonstat; diff --git a/tables/cd_achievement.tab b/tables/cd_achievement.tab deleted file mode 100755 index 3ac2b74..0000000 --- a/tables/cd_achievement.tab +++ /dev/null @@ -1,13 +0,0 @@ -CREATE TABLE xonstat.cd_achievement -( - achievement_cd integer NOT NULL, - descr character varying(100) NOT NULL, - "limit" integer, - active_ind boolean NOT NULL DEFAULT true, - CONSTRAINT cd_achievement_pk PRIMARY KEY (achievement_cd) -) -WITH ( - OIDS=FALSE -); -ALTER TABLE xonstat.cd_achievement OWNER TO xonstat; - diff --git a/tables/cd_game_type.tab b/tables/cd_game_type.tab deleted file mode 100755 index 10ad63e..0000000 --- a/tables/cd_game_type.tab +++ /dev/null @@ -1,11 +0,0 @@ -CREATE TABLE xonstat.cd_game_type -( - game_type_cd character varying(10) NOT NULL, - descr character varying(100) NOT NULL, - active_ind boolean NOT NULL DEFAULT true, - CONSTRAINT cd_game_type_pk PRIMARY KEY (game_type_cd) -) -WITH ( - OIDS=FALSE -); -ALTER TABLE xonstat.cd_game_type OWNER TO xonstat; diff --git a/tables/cd_ladder.tab b/tables/cd_ladder.tab deleted file mode 100755 index fe3ad92..0000000 --- a/tables/cd_ladder.tab +++ /dev/null @@ -1,15 +0,0 @@ -CREATE TABLE xonstat.cd_ladder -( - ladder_cd serial NOT NULL, - name character varying(100) NOT NULL, - descr character varying(200) NOT NULL, - create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'), - start_dt date NOT NULL, - end_dt date NOT NULL, - active_ind boolean NOT NULL DEFAULT true, - CONSTRAINT cd_ladder_pk PRIMARY KEY (ladder_cd) -) -WITH ( - OIDS=FALSE -); -ALTER TABLE xonstat.cd_ladder OWNER TO xonstat; diff --git a/tables/cd_mutator.tab b/tables/cd_mutator.tab deleted file mode 100755 index 6d40726..0000000 --- a/tables/cd_mutator.tab +++ /dev/null @@ -1,12 +0,0 @@ -CREATE TABLE xonstat.cd_mutator -( - mutator_cd integer NOT NULL, - "name" character varying(64) NOT NULL, - descr character varying(100), - active_ind boolean NOT NULL DEFAULT true, - CONSTRAINT cd_mutator_pk PRIMARY KEY (mutator_cd) -) -WITH ( - OIDS=FALSE -); -ALTER TABLE xonstat.cd_mutator OWNER TO xonstat; diff --git a/tables/cd_weapon.tab b/tables/cd_weapon.tab deleted file mode 100755 index 5b088ed..0000000 --- a/tables/cd_weapon.tab +++ /dev/null @@ -1,11 +0,0 @@ -CREATE TABLE xonstat.cd_weapon -( - weapon_cd character varying(15) NOT NULL, - descr character varying(100) NOT NULL, - active_ind boolean NOT NULL DEFAULT true, - CONSTRAINT cd_weapon_pk PRIMARY KEY (weapon_cd) -) -WITH ( - OIDS=FALSE -); -ALTER TABLE xonstat.cd_weapon OWNER TO xonstat; diff --git a/tables/db_version.tab b/tables/db_version.tab deleted file mode 100755 index 967fcc6..0000000 --- a/tables/db_version.tab +++ /dev/null @@ -1,11 +0,0 @@ -CREATE TABLE xonstat.db_version -( - "version" character varying(15) NOT NULL, - descr character varying(100) NOT NULL, - create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'), - CONSTRAINT db_version_pk PRIMARY KEY (version) -) -WITH ( - OIDS=FALSE -); -ALTER TABLE xonstat.db_version OWNER TO xonstat; diff --git a/tables/game_mutators.tab b/tables/game_mutators.tab deleted file mode 100755 index 76d0282..0000000 --- a/tables/game_mutators.tab +++ /dev/null @@ -1,16 +0,0 @@ -CREATE TABLE xonstat.game_mutators -( - game_id bigint NOT NULL, - mutator_cd integer NOT NULL, - CONSTRAINT game_mutators_pk PRIMARY KEY (game_id, mutator_cd), - CONSTRAINT game_mutators_fk001 FOREIGN KEY (game_id) - REFERENCES xonstat.games (game_id) MATCH SIMPLE - ON UPDATE NO ACTION ON DELETE NO ACTION, - CONSTRAINT game_mutators_fk002 FOREIGN KEY (mutator_cd) - REFERENCES xonstat.cd_mutator (mutator_cd) MATCH SIMPLE - ON UPDATE NO ACTION ON DELETE NO ACTION -) -WITH ( - OIDS=FALSE -); -ALTER TABLE xonstat.game_mutators OWNER TO xonstat; diff --git a/tables/games.tab b/tables/games.tab deleted file mode 100755 index 831208f..0000000 --- a/tables/games.tab +++ /dev/null @@ -1,323 +0,0 @@ -CREATE TABLE xonstat.games -( - game_id bigserial NOT NULL, - start_dt timestamp without time zone NOT NULL, - game_type_cd character varying(10) NOT NULL, - server_id integer NOT NULL, - map_id integer NOT NULL, - duration interval, - winner integer, - match_id character varying(64), - mod character varying(64), - create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'), - players integer[], - CONSTRAINT games_pk PRIMARY KEY (game_id), - CONSTRAINT games_fk001 FOREIGN KEY (game_type_cd) - REFERENCES xonstat.cd_game_type (game_type_cd) MATCH SIMPLE - ON UPDATE NO ACTION ON DELETE NO ACTION, - CONSTRAINT games_fk002 FOREIGN KEY (server_id) - REFERENCES xonstat.servers (server_id) MATCH SIMPLE - ON UPDATE NO ACTION ON DELETE NO ACTION, - CONSTRAINT games_fk003 FOREIGN KEY (map_id) - REFERENCES xonstat.maps (map_id) MATCH SIMPLE - ON UPDATE NO ACTION ON DELETE NO ACTION, - CONSTRAINT games_uk001 UNIQUE (server_id, match_id) -) -WITH ( - OIDS=FALSE -); -CREATE INDEX games_ix001 on games(create_dt); -ALTER TABLE xonstat.games OWNER TO xonstat; - -CREATE TABLE IF NOT EXISTS xonstat.games_2014q1 ( - CHECK ( create_dt >= DATE '2014-01-01' AND create_dt < DATE '2014-04-01' ) -) INHERITS (games); - -CREATE TABLE IF NOT EXISTS xonstat.games_2014q2 ( - CHECK ( create_dt >= DATE '2014-04-01' AND create_dt < DATE '2014-07-01' ) -) INHERITS (games); - -CREATE TABLE IF NOT EXISTS xonstat.games_2014q3 ( - CHECK ( create_dt >= DATE '2014-07-01' AND create_dt < DATE '2014-10-01' ) -) INHERITS (games); - -CREATE TABLE IF NOT EXISTS xonstat.games_2014q4 ( - CHECK ( create_dt >= DATE '2014-10-01' AND create_dt < DATE '2015-01-01' ) -) INHERITS (games); - -CREATE TABLE IF NOT EXISTS xonstat.games_2015q1 ( - CHECK ( create_dt >= DATE '2015-01-01' AND create_dt < DATE '2015-04-01' ) -) INHERITS (games); - -CREATE TABLE IF NOT EXISTS xonstat.games_2015q2 ( - CHECK ( create_dt >= DATE '2015-04-01' AND create_dt < DATE '2015-07-01' ) -) INHERITS (games); - -CREATE TABLE IF NOT EXISTS xonstat.games_2015q3 ( - CHECK ( create_dt >= DATE '2015-07-01' AND create_dt < DATE '2015-10-01' ) -) INHERITS (games); - -CREATE TABLE IF NOT EXISTS xonstat.games_2015q4 ( - CHECK ( create_dt >= DATE '2015-10-01' AND create_dt < DATE '2016-01-01' ) -) INHERITS (games); - -CREATE TABLE IF NOT EXISTS xonstat.games_2016q1 ( - CHECK ( create_dt >= DATE '2016-01-01' AND create_dt < DATE '2016-04-01' ) -) INHERITS (games); - -CREATE TABLE IF NOT EXISTS xonstat.games_2016q2 ( - CHECK ( create_dt >= DATE '2016-04-01' AND create_dt < DATE '2016-07-01' ) -) INHERITS (games); - -CREATE TABLE IF NOT EXISTS xonstat.games_2016q3 ( - CHECK ( create_dt >= DATE '2016-07-01' AND create_dt < DATE '2016-10-01' ) -) INHERITS (games); - -CREATE TABLE IF NOT EXISTS xonstat.games_2016q4 ( - CHECK ( create_dt >= DATE '2016-10-01' AND create_dt < DATE '2017-01-01' ) -) INHERITS (games); - -CREATE TABLE IF NOT EXISTS xonstat.games_2017q1 ( - CHECK ( create_dt >= DATE '2017-01-01' AND create_dt < DATE '2017-04-01' ) -) INHERITS (games); - -CREATE TABLE IF NOT EXISTS xonstat.games_2017q2 ( - CHECK ( create_dt >= DATE '2017-04-01' AND create_dt < DATE '2017-07-01' ) -) INHERITS (games); - -CREATE TABLE IF NOT EXISTS xonstat.games_2017q3 ( - CHECK ( create_dt >= DATE '2017-07-01' AND create_dt < DATE '2017-10-01' ) -) INHERITS (games); - -CREATE TABLE IF NOT EXISTS xonstat.games_2017q4 ( - CHECK ( create_dt >= DATE '2017-10-01' AND create_dt < DATE '2018-01-01' ) -) INHERITS (games); - -CREATE TABLE IF NOT EXISTS xonstat.games_2018q1 ( - CHECK ( create_dt >= DATE '2018-01-01' AND create_dt < DATE '2018-04-01' ) -) INHERITS (games); - -CREATE TABLE IF NOT EXISTS xonstat.games_2018q2 ( - CHECK ( create_dt >= DATE '2018-04-01' AND create_dt < DATE '2018-07-01' ) -) INHERITS (games); - -CREATE TABLE IF NOT EXISTS xonstat.games_2018q3 ( - CHECK ( create_dt >= DATE '2018-07-01' AND create_dt < DATE '2018-10-01' ) -) INHERITS (games); - -CREATE TABLE IF NOT EXISTS xonstat.games_2018q4 ( - CHECK ( create_dt >= DATE '2018-10-01' AND create_dt < DATE '2019-01-01' ) -) INHERITS (games); - -CREATE TABLE IF NOT EXISTS xonstat.games_2019q1 ( - CHECK ( create_dt >= DATE '2019-01-01' AND create_dt < DATE '2019-04-01' ) -) INHERITS (games); - -CREATE TABLE IF NOT EXISTS xonstat.games_2019q2 ( - CHECK ( create_dt >= DATE '2019-04-01' AND create_dt < DATE '2019-07-01' ) -) INHERITS (games); - -CREATE TABLE IF NOT EXISTS xonstat.games_2019q3 ( - CHECK ( create_dt >= DATE '2019-07-01' AND create_dt < DATE '2019-10-01' ) -) INHERITS (games); - -CREATE TABLE IF NOT EXISTS xonstat.games_2019q4 ( - CHECK ( create_dt >= DATE '2019-10-01' AND create_dt < DATE '2020-01-01' ) -) INHERITS (games); - -CREATE TABLE IF NOT EXISTS xonstat.games_2020q1 ( - CHECK ( create_dt >= DATE '2020-01-01' AND create_dt < DATE '2020-04-01' ) -) INHERITS (games); - -CREATE TABLE IF NOT EXISTS xonstat.games_2020q2 ( - CHECK ( create_dt >= DATE '2020-04-01' AND create_dt < DATE '2020-07-01' ) -) INHERITS (games); - -CREATE TABLE IF NOT EXISTS xonstat.games_2020q3 ( - CHECK ( create_dt >= DATE '2020-07-01' AND create_dt < DATE '2020-10-01' ) -) INHERITS (games); - -CREATE TABLE IF NOT EXISTS xonstat.games_2020q4 ( - CHECK ( create_dt >= DATE '2020-10-01' AND create_dt < DATE '2021-01-01' ) -) INHERITS (games); - -CREATE TABLE IF NOT EXISTS xonstat.games_2021q1 ( - CHECK ( create_dt >= DATE '2021-01-01' AND create_dt < DATE '2021-04-01' ) -) INHERITS (games); - -CREATE INDEX games_2021q1_ix001 on games_2021q1(create_dt); -CREATE INDEX games_2021q1_ix002 on games_2021q1 using gin(players); -CREATE UNIQUE INDEX games_2021q1_pk on games_2021q1(game_id); -ALTER TABLE games_2021q1 ADD PRIMARY KEY USING INDEX games_2021q1_pk; - -CREATE TABLE IF NOT EXISTS xonstat.games_2021q2 ( - CHECK ( create_dt >= DATE '2021-04-01' AND create_dt < DATE '2021-07-01' ) -) INHERITS (games); - -CREATE INDEX games_2021q2_ix001 on games_2021q2(create_dt); -CREATE INDEX games_2021q2_ix002 on games_2021q2 using gin(players); -CREATE UNIQUE INDEX games_2021q2_pk on games_2021q2(game_id); -ALTER TABLE games_2021q2 ADD PRIMARY KEY USING INDEX games_2021q2_pk; - -CREATE TABLE IF NOT EXISTS xonstat.games_2021q3 ( - CHECK ( create_dt >= DATE '2021-07-01' AND create_dt < DATE '2021-10-01' ) -) INHERITS (games); - -CREATE INDEX games_2021q3_ix001 on games_2021q3(create_dt); -CREATE INDEX games_2021q3_ix002 on games_2021q3 using gin(players); -CREATE UNIQUE INDEX games_2021q3_pk on games_2021q3(game_id); -ALTER TABLE games_2021q3 ADD PRIMARY KEY USING INDEX games_2021q3_pk; - -CREATE TABLE IF NOT EXISTS xonstat.games_2021q4 ( - CHECK ( create_dt >= DATE '2021-10-01' AND create_dt < DATE '2022-01-01' ) -) INHERITS (games); - -CREATE INDEX games_2021q4_ix001 on games_2021q4(create_dt); -CREATE INDEX games_2021q4_ix002 on games_2021q4 using gin(players); -CREATE UNIQUE INDEX games_2021q4_pk on games_2021q4(game_id); -ALTER TABLE games_2021q4 ADD PRIMARY KEY USING INDEX games_2021q4_pk; - -CREATE TABLE IF NOT EXISTS xonstat.games_2022q1 ( - CHECK ( create_dt >= DATE '2022-01-01' AND create_dt < DATE '2022-04-01' ) -) INHERITS (games); - -CREATE INDEX games_2022q1_ix001 on games_2022q1(create_dt); -CREATE INDEX games_2022q1_ix002 on games_2022q1 using gin(players); -CREATE UNIQUE INDEX games_2022q1_pk on games_2022q1(game_id); -ALTER TABLE games_2022q1 ADD PRIMARY KEY USING INDEX games_2022q1_pk; - -CREATE TABLE IF NOT EXISTS xonstat.games_2022q2 ( - CHECK ( create_dt >= DATE '2022-04-01' AND create_dt < DATE '2022-07-01' ) -) INHERITS (games); - -CREATE INDEX games_2022q2_ix001 on games_2022q2(create_dt); -CREATE INDEX games_2022q2_ix002 on games_2022q2 using gin(players); -CREATE UNIQUE INDEX games_2022q2_pk on games_2022q2(game_id); -ALTER TABLE games_2022q2 ADD PRIMARY KEY USING INDEX games_2022q2_pk; - -CREATE TABLE IF NOT EXISTS xonstat.games_2022q3 ( - CHECK ( create_dt >= DATE '2022-07-01' AND create_dt < DATE '2022-10-01' ) -) INHERITS (games); - -CREATE INDEX games_2022q3_ix001 on games_2022q3(create_dt); -CREATE INDEX games_2022q3_ix002 on games_2022q3 using gin(players); -CREATE UNIQUE INDEX games_2022q3_pk on games_2022q3(game_id); -ALTER TABLE games_2022q3 ADD PRIMARY KEY USING INDEX games_2022q3_pk; - -CREATE TABLE IF NOT EXISTS xonstat.games_2022q4 ( - CHECK ( create_dt >= DATE '2022-10-01' AND create_dt < DATE '2023-01-01' ) -) INHERITS (games); - -CREATE INDEX games_2022q4_ix001 on games_2022q4(create_dt); -CREATE INDEX games_2022q4_ix002 on games_2022q4 using gin(players); -CREATE UNIQUE INDEX games_2022q4_pk on games_2022q4(game_id); -ALTER TABLE games_2022q4 ADD PRIMARY KEY USING INDEX games_2022q4_pk; - -CREATE TABLE IF NOT EXISTS xonstat.games_2023q1 ( - CHECK ( create_dt >= DATE '2023-01-01' AND create_dt < DATE '2023-04-01' ) -) INHERITS (games); - -CREATE INDEX games_2023q1_ix001 on games_2023q1(create_dt); -CREATE INDEX games_2023q1_ix002 on games_2023q1 using gin(players); -CREATE UNIQUE INDEX games_2023q1_pk on games_2023q1(game_id); -ALTER TABLE games_2023q1 ADD PRIMARY KEY USING INDEX games_2023q1_pk; - -CREATE TABLE IF NOT EXISTS xonstat.games_2023q2 ( - CHECK ( create_dt >= DATE '2023-04-01' AND create_dt < DATE '2023-07-01' ) -) INHERITS (games); - -CREATE INDEX games_2023q2_ix001 on games_2023q2(create_dt); -CREATE INDEX games_2023q2_ix002 on games_2023q2 using gin(players); -CREATE UNIQUE INDEX games_2023q2_pk on games_2023q2(game_id); -ALTER TABLE games_2023q2 ADD PRIMARY KEY USING INDEX games_2023q2_pk; - -CREATE TABLE IF NOT EXISTS xonstat.games_2023q3 ( - CHECK ( create_dt >= DATE '2023-07-01' AND create_dt < DATE '2023-10-01' ) -) INHERITS (games); - -CREATE INDEX games_2023q3_ix001 on games_2023q3(create_dt); -CREATE INDEX games_2023q3_ix002 on games_2023q3 using gin(players); -CREATE UNIQUE INDEX games_2023q3_pk on games_2023q3(game_id); -ALTER TABLE games_2023q3 ADD PRIMARY KEY USING INDEX games_2023q3_pk; - -CREATE TABLE IF NOT EXISTS xonstat.games_2023q4 ( - CHECK ( create_dt >= DATE '2023-10-01' AND create_dt < DATE '2024-01-01' ) -) INHERITS (games); - -CREATE INDEX games_2023q4_ix001 on games_2023q4(create_dt); -CREATE INDEX games_2023q4_ix002 on games_2023q4 using gin(players); -CREATE UNIQUE INDEX games_2023q4_pk on games_2023q4(game_id); -ALTER TABLE games_2023q4 ADD PRIMARY KEY USING INDEX games_2023q4_pk; - -CREATE TABLE IF NOT EXISTS xonstat.games_2024q1 ( - CHECK ( create_dt >= DATE '2024-01-01' AND create_dt < DATE '2024-04-01' ) -) INHERITS (games); - -CREATE INDEX games_2024q1_ix001 on games_2024q1(create_dt); -CREATE INDEX games_2024q1_ix002 on games_2024q1 using gin(players); -CREATE UNIQUE INDEX games_2024q1_pk on games_2024q1(game_id); -ALTER TABLE games_2024q1 ADD PRIMARY KEY USING INDEX games_2024q1_pk; - -CREATE TABLE IF NOT EXISTS xonstat.games_2024q2 ( - CHECK ( create_dt >= DATE '2024-04-01' AND create_dt < DATE '2024-07-01' ) -) INHERITS (games); - -CREATE INDEX games_2024q2_ix001 on games_2024q2(create_dt); -CREATE INDEX games_2024q2_ix002 on games_2024q2 using gin(players); -CREATE UNIQUE INDEX games_2024q2_pk on games_2024q2(game_id); -ALTER TABLE games_2024q2 ADD PRIMARY KEY USING INDEX games_2024q2_pk; - -CREATE TABLE IF NOT EXISTS xonstat.games_2024q3 ( - CHECK ( create_dt >= DATE '2024-07-01' AND create_dt < DATE '2024-10-01' ) -) INHERITS (games); - -CREATE INDEX games_2024q3_ix001 on games_2024q3(create_dt); -CREATE INDEX games_2024q3_ix002 on games_2024q3 using gin(players); -CREATE UNIQUE INDEX games_2024q3_pk on games_2024q3(game_id); -ALTER TABLE games_2024q3 ADD PRIMARY KEY USING INDEX games_2024q3_pk; - -CREATE TABLE IF NOT EXISTS xonstat.games_2024q4 ( - CHECK ( create_dt >= DATE '2024-10-01' AND create_dt < DATE '2025-01-01' ) -) INHERITS (games); - -CREATE INDEX games_2024q4_ix001 on games_2024q4(create_dt); -CREATE INDEX games_2024q4_ix002 on games_2024q4 using gin(players); -CREATE UNIQUE INDEX games_2024q4_pk on games_2024q4(game_id); -ALTER TABLE games_2024q4 ADD PRIMARY KEY USING INDEX games_2024q4_pk; - -CREATE TABLE IF NOT EXISTS xonstat.games_2025q1 ( - CHECK ( create_dt >= DATE '2025-01-01' AND create_dt < DATE '2025-04-01' ) -) INHERITS (games); - -CREATE INDEX games_2025q1_ix001 on games_2025q1(create_dt); -CREATE INDEX games_2025q1_ix002 on games_2025q1 using gin(players); -CREATE UNIQUE INDEX games_2025q1_pk on games_2025q1(game_id); -ALTER TABLE games_2025q1 ADD PRIMARY KEY USING INDEX games_2025q1_pk; - -CREATE TABLE IF NOT EXISTS xonstat.games_2025q2 ( - CHECK ( create_dt >= DATE '2025-04-01' AND create_dt < DATE '2025-07-01' ) -) INHERITS (games); - -CREATE INDEX games_2025q2_ix001 on games_2025q2(create_dt); -CREATE INDEX games_2025q2_ix002 on games_2025q2 using gin(players); -CREATE UNIQUE INDEX games_2025q2_pk on games_2025q2(game_id); -ALTER TABLE games_2025q2 ADD PRIMARY KEY USING INDEX games_2025q2_pk; - -CREATE TABLE IF NOT EXISTS xonstat.games_2025q3 ( - CHECK ( create_dt >= DATE '2025-07-01' AND create_dt < DATE '2025-10-01' ) -) INHERITS (games); - -CREATE INDEX games_2025q3_ix001 on games_2025q3(create_dt); -CREATE INDEX games_2025q3_ix002 on games_2025q3 using gin(players); -CREATE UNIQUE INDEX games_2025q3_pk on games_2025q3(game_id); -ALTER TABLE games_2025q3 ADD PRIMARY KEY USING INDEX games_2025q3_pk; - -CREATE TABLE IF NOT EXISTS xonstat.games_2025q4 ( - CHECK ( create_dt >= DATE '2025-10-01' AND create_dt < DATE '2026-01-01' ) -) INHERITS (games); - -CREATE INDEX games_2025q4_ix001 on games_2025q4(create_dt); -CREATE INDEX games_2025q4_ix002 on games_2025q4 using gin(players); -CREATE UNIQUE INDEX games_2025q4_pk on games_2025q4(game_id); -ALTER TABLE games_2025q4 ADD PRIMARY KEY USING INDEX games_2025q4_pk; - diff --git a/tables/hashkeys.tab b/tables/hashkeys.tab deleted file mode 100755 index 1f0243d..0000000 --- a/tables/hashkeys.tab +++ /dev/null @@ -1,16 +0,0 @@ -CREATE TABLE xonstat.hashkeys -( - player_id integer NOT NULL, - hashkey character varying(44) NOT NULL, - active_ind boolean NOT NULL DEFAULT true, - create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'), - CONSTRAINT hashkeys_pk PRIMARY KEY (player_id, hashkey), - CONSTRAINT hashkeys_fk001 FOREIGN KEY (player_id) - REFERENCES xonstat.players (player_id) MATCH SIMPLE - ON UPDATE NO ACTION ON DELETE NO ACTION, - CONSTRAINT hashkeys_uk001 UNIQUE (hashkey) -) -WITH ( - OIDS=FALSE -); -ALTER TABLE xonstat.hashkeys OWNER TO xonstat; diff --git a/tables/map_game_types.tab b/tables/map_game_types.tab deleted file mode 100755 index cdbe34a..0000000 --- a/tables/map_game_types.tab +++ /dev/null @@ -1,16 +0,0 @@ -CREATE TABLE xonstat.map_game_types -( - map_id integer NOT NULL, - game_type_cd character varying(10) NOT NULL, - CONSTRAINT map_game_types_pk PRIMARY KEY (map_id, game_type_cd), - CONSTRAINT map_game_types_fk001 FOREIGN KEY (map_id) - REFERENCES xonstat.maps (map_id) MATCH SIMPLE - ON UPDATE NO ACTION ON DELETE NO ACTION, - CONSTRAINT map_game_types_fk002 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.map_game_types OWNER TO xonstat; diff --git a/tables/maps.tab b/tables/maps.tab deleted file mode 100755 index a186a4e..0000000 --- a/tables/maps.tab +++ /dev/null @@ -1,14 +0,0 @@ -CREATE TABLE xonstat.maps -( - map_id serial NOT NULL, - "name" character varying(64) NOT NULL, - "version" integer NOT NULL DEFAULT 1, - pk3_name character varying(100), - curl_url character varying(300), - create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'), - CONSTRAINT maps_pk PRIMARY KEY (map_id) -) -WITH ( - OIDS=FALSE -); -ALTER TABLE xonstat.maps OWNER TO xonstat; diff --git a/tables/merged_servers.tab b/tables/merged_servers.tab deleted file mode 100755 index ab7ec3f..0000000 --- a/tables/merged_servers.tab +++ /dev/null @@ -1,13 +0,0 @@ -CREATE TABLE xonstat.merged_servers -( - winning_server_id integer NOT NULL, - losing_server_id integer NOT NULL, - unmerged_ind boolean NOT NULL DEFAULT false, - create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'), - CONSTRAINT merged_servers_pk PRIMARY KEY (winning_server_id, losing_server_id) -) -WITH ( - OIDS=FALSE -); - -ALTER TABLE xonstat.merged_servers OWNER TO xonstat; diff --git a/tables/player_agg_stats_mv.tab b/tables/player_agg_stats_mv.tab deleted file mode 100755 index e2dc860..0000000 --- a/tables/player_agg_stats_mv.tab +++ /dev/null @@ -1,26 +0,0 @@ -CREATE TABLE xonstat.player_agg_stats_mv -( - player_id integer NOT NULL, - game_type_cd character varying(10), - nick character varying(128), - stripped_nick character varying(128), - last_seen timestamp without time zone, - games integer, - wins integer, - losses integer, - kills integer, - deaths integer, - suicides integer, - captures integer, - pickups integer, - drops integer, - carrier_frags integer, - alivetime bigint, - create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'), - CONSTRAINT player_agg_stats_mv_pk PRIMARY KEY (player_id, game_type_cd) -) -WITH ( - OIDS=FALSE -); - -ALTER TABLE xonstat.player_agg_stats_mv OWNER TO xonstat; diff --git a/tables/player_elos.tab b/tables/player_elos.tab deleted file mode 100755 index 24d8d90..0000000 --- a/tables/player_elos.tab +++ /dev/null @@ -1,22 +0,0 @@ -CREATE TABLE xonstat.player_elos -( - player_id integer NOT NULL, - game_type_cd character varying(10) NOT NULL, - category character varying(10) NOT NULL default 'general', - games integer NOT NULL default 0, - elo 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_elos_pk PRIMARY KEY (player_id, game_type_cd, category), - CONSTRAINT player_elos_fk01 FOREIGN KEY (player_id) - REFERENCES xonstat.players (player_id) MATCH SIMPLE - ON UPDATE NO ACTION ON DELETE NO ACTION, - CONSTRAINT player_elos_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_elos OWNER TO xonstat; diff --git a/tables/player_game_anticheats.tab b/tables/player_game_anticheats.tab deleted file mode 100755 index 54967e3..0000000 --- a/tables/player_game_anticheats.tab +++ /dev/null @@ -1,20 +0,0 @@ -CREATE TABLE xonstat.player_game_anticheats -( - player_game_anticheat_id bigserial NOT NULL, - player_id integer NOT NULL, - game_id bigint NOT NULL, - key character varying(128), - value numeric, - create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'), - CONSTRAINT player_game_anticheats_pk PRIMARY KEY (player_game_anticheat_id), - CONSTRAINT player_game_anticheats_fk01 FOREIGN KEY (player_id) - REFERENCES players (player_id) MATCH SIMPLE - ON UPDATE NO ACTION ON DELETE NO ACTION -) -WITH ( - OIDS=FALSE -); - -CREATE INDEX player_game_anticheats_ix01 on player_game_anticheats(game_id); -CREATE INDEX player_game_anticheats_ix02 on player_game_anticheats(player_id); -ALTER TABLE xonstat.player_game_anticheats OWNER TO xonstat; diff --git a/tables/player_game_frag_matrix.tab b/tables/player_game_frag_matrix.tab deleted file mode 100755 index f27834c..0000000 --- a/tables/player_game_frag_matrix.tab +++ /dev/null @@ -1,246 +0,0 @@ -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 json 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 -); - -CREATE INDEX player_game_frag_matrix_ix01 on player_game_frag_matrix(create_dt); -CREATE INDEX player_game_frag_matrix_ix02 on player_game_frag_matrix(game_id); - -ALTER TABLE xonstat.player_game_frag_matrix OWNER TO xonstat; - -CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2017q3 ( - CHECK ( create_dt >= DATE '2017-07-01' AND create_dt < DATE '2017-10-01' ) -) INHERITS (player_game_frag_matrix); - -CREATE INDEX player_game_frag_matrix_2017q3_ix001 on player_game_frag_matrix_2017q3(create_dt); -CREATE INDEX player_game_frag_matrix_2017q3_ix002 on player_game_frag_matrix_2017q3(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2017q4 ( - CHECK ( create_dt >= DATE '2017-10-01' AND create_dt < DATE '2018-01-01' ) -) INHERITS (player_game_frag_matrix); - -CREATE INDEX player_game_frag_matrix_2017q4_ix001 on player_game_frag_matrix_2017q4(create_dt); -CREATE INDEX player_game_frag_matrix_2017q4_ix002 on player_game_frag_matrix_2017q4(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2018q1 ( - CHECK ( create_dt >= DATE '2018-01-01' AND create_dt < DATE '2018-04-01' ) -) INHERITS (player_game_frag_matrix); - -CREATE INDEX player_game_frag_matrix_2018q1_ix001 on player_game_frag_matrix_2018q1(create_dt); -CREATE INDEX player_game_frag_matrix_2018q1_ix002 on player_game_frag_matrix_2018q1(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2018q2 ( - CHECK ( create_dt >= DATE '2018-04-01' AND create_dt < DATE '2018-07-01' ) -) INHERITS (player_game_frag_matrix); - -CREATE INDEX player_game_frag_matrix_2018q2_ix001 on player_game_frag_matrix_2018q2(create_dt); -CREATE INDEX player_game_frag_matrix_2018q2_ix002 on player_game_frag_matrix_2018q2(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2018q3 ( - CHECK ( create_dt >= DATE '2018-07-01' AND create_dt < DATE '2018-10-01' ) -) INHERITS (player_game_frag_matrix); - -CREATE INDEX player_game_frag_matrix_2018q3_ix001 on player_game_frag_matrix_2018q3(create_dt); -CREATE INDEX player_game_frag_matrix_2018q3_ix002 on player_game_frag_matrix_2018q3(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2018q4 ( - CHECK ( create_dt >= DATE '2018-10-01' AND create_dt < DATE '2019-01-01' ) -) INHERITS (player_game_frag_matrix); - -CREATE INDEX player_game_frag_matrix_2018q4_ix001 on player_game_frag_matrix_2018q4(create_dt); -CREATE INDEX player_game_frag_matrix_2018q4_ix002 on player_game_frag_matrix_2018q4(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2019q1 ( - CHECK ( create_dt >= DATE '2019-01-01' AND create_dt < DATE '2019-04-01' ) -) INHERITS (player_game_frag_matrix); - -CREATE INDEX player_game_frag_matrix_2019q1_ix001 on player_game_frag_matrix_2019q1(create_dt); -CREATE INDEX player_game_frag_matrix_2019q1_ix002 on player_game_frag_matrix_2019q1(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2019q2 ( - CHECK ( create_dt >= DATE '2019-04-01' AND create_dt < DATE '2019-07-01' ) -) INHERITS (player_game_frag_matrix); - -CREATE INDEX player_game_frag_matrix_2019q2_ix001 on player_game_frag_matrix_2019q2(create_dt); -CREATE INDEX player_game_frag_matrix_2019q2_ix002 on player_game_frag_matrix_2019q2(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2019q3 ( - CHECK ( create_dt >= DATE '2019-07-01' AND create_dt < DATE '2019-10-01' ) -) INHERITS (player_game_frag_matrix); - -CREATE INDEX player_game_frag_matrix_2019q3_ix001 on player_game_frag_matrix_2019q3(create_dt); -CREATE INDEX player_game_frag_matrix_2019q3_ix002 on player_game_frag_matrix_2019q3(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2019q4 ( - CHECK ( create_dt >= DATE '2019-10-01' AND create_dt < DATE '2020-01-01' ) -) INHERITS (player_game_frag_matrix); - -CREATE INDEX player_game_frag_matrix_2019q4_ix001 on player_game_frag_matrix_2019q4(create_dt); -CREATE INDEX player_game_frag_matrix_2019q4_ix002 on player_game_frag_matrix_2019q4(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2020q1 ( - CHECK ( create_dt >= DATE '2020-01-01' AND create_dt < DATE '2020-04-01' ) -) INHERITS (player_game_frag_matrix); - -CREATE INDEX player_game_frag_matrix_2020q1_ix001 on player_game_frag_matrix_2020q1(create_dt); -CREATE INDEX player_game_frag_matrix_2020q1_ix002 on player_game_frag_matrix_2020q1(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2020q2 ( - CHECK ( create_dt >= DATE '2020-04-01' AND create_dt < DATE '2020-07-01' ) -) INHERITS (player_game_frag_matrix); - -CREATE INDEX player_game_frag_matrix_2020q2_ix001 on player_game_frag_matrix_2020q2(create_dt); -CREATE INDEX player_game_frag_matrix_2020q2_ix002 on player_game_frag_matrix_2020q2(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2020q3 ( - CHECK ( create_dt >= DATE '2020-07-01' AND create_dt < DATE '2020-10-01' ) -) INHERITS (player_game_frag_matrix); - -CREATE INDEX player_game_frag_matrix_2020q3_ix001 on player_game_frag_matrix_2020q3(create_dt); -CREATE INDEX player_game_frag_matrix_2020q3_ix002 on player_game_frag_matrix_2020q3(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2020q4 ( - CHECK ( create_dt >= DATE '2020-10-01' AND create_dt < DATE '2021-01-01' ) -) INHERITS (player_game_frag_matrix); - -CREATE INDEX player_game_frag_matrix_2020q4_ix001 on player_game_frag_matrix_2020q4(create_dt); -CREATE INDEX player_game_frag_matrix_2020q4_ix002 on player_game_frag_matrix_2020q4(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2021q1 ( - CHECK ( create_dt >= DATE '2021-01-01' AND create_dt < DATE '2021-04-01' ) -) INHERITS (player_game_frag_matrix); - -CREATE INDEX player_game_frag_matrix_2021q1_ix001 on player_game_frag_matrix_2021q1(create_dt); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2021q2 ( - CHECK ( create_dt >= DATE '2021-04-01' AND create_dt < DATE '2021-07-01' ) -) INHERITS (player_game_frag_matrix); - -CREATE INDEX player_game_frag_matrix_2021q2_ix001 on player_game_frag_matrix_2021q2(create_dt); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2021q3 ( - CHECK ( create_dt >= DATE '2021-07-01' AND create_dt < DATE '2021-10-01' ) -) INHERITS (player_game_frag_matrix); - -CREATE INDEX player_game_frag_matrix_2021q3_ix001 on player_game_frag_matrix_2021q3(create_dt); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2021q4 ( - CHECK ( create_dt >= DATE '2021-10-01' AND create_dt < DATE '2022-01-01' ) -) INHERITS (player_game_frag_matrix); - -CREATE INDEX player_game_frag_matrix_2021q4_ix001 on player_game_frag_matrix_2021q4(create_dt); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2022q1 ( - CHECK ( create_dt >= DATE '2022-01-01' AND create_dt < DATE '2022-04-01' ) -) INHERITS (player_game_frag_matrix); - -CREATE INDEX player_game_frag_matrix_2022q1_ix001 on player_game_frag_matrix_2022q1(create_dt); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2022q2 ( - CHECK ( create_dt >= DATE '2022-04-01' AND create_dt < DATE '2022-07-01' ) -) INHERITS (player_game_frag_matrix); - -CREATE INDEX player_game_frag_matrix_2022q2_ix001 on player_game_frag_matrix_2022q2(create_dt); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2022q3 ( - CHECK ( create_dt >= DATE '2022-07-01' AND create_dt < DATE '2022-10-01' ) -) INHERITS (player_game_frag_matrix); - -CREATE INDEX player_game_frag_matrix_2022q3_ix001 on player_game_frag_matrix_2022q3(create_dt); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2022q4 ( - CHECK ( create_dt >= DATE '2022-10-01' AND create_dt < DATE '2023-01-01' ) -) INHERITS (player_game_frag_matrix); - -CREATE INDEX player_game_frag_matrix_2022q4_ix001 on player_game_frag_matrix_2022q4(create_dt); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2023q1 ( - CHECK ( create_dt >= DATE '2023-01-01' AND create_dt < DATE '2023-04-01' ) -) INHERITS (player_game_frag_matrix); - -CREATE INDEX player_game_frag_matrix_2023q1_ix001 on player_game_frag_matrix_2023q1(create_dt); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2023q2 ( - CHECK ( create_dt >= DATE '2023-04-01' AND create_dt < DATE '2023-07-01' ) -) INHERITS (player_game_frag_matrix); - -CREATE INDEX player_game_frag_matrix_2023q2_ix001 on player_game_frag_matrix_2023q2(create_dt); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2023q3 ( - CHECK ( create_dt >= DATE '2023-07-01' AND create_dt < DATE '2023-10-01' ) -) INHERITS (player_game_frag_matrix); - -CREATE INDEX player_game_frag_matrix_2023q3_ix001 on player_game_frag_matrix_2023q3(create_dt); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2023q4 ( - CHECK ( create_dt >= DATE '2023-10-01' AND create_dt < DATE '2024-01-01' ) -) INHERITS (player_game_frag_matrix); - -CREATE INDEX player_game_frag_matrix_2023q4_ix001 on player_game_frag_matrix_2023q4(create_dt); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2024q1 ( - CHECK ( create_dt >= DATE '2024-01-01' AND create_dt < DATE '2024-04-01' ) -) INHERITS (player_game_frag_matrix); - -CREATE INDEX player_game_frag_matrix_2024q1_ix001 on player_game_frag_matrix_2024q1(create_dt); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2024q2 ( - CHECK ( create_dt >= DATE '2024-04-01' AND create_dt < DATE '2024-07-01' ) -) INHERITS (player_game_frag_matrix); - -CREATE INDEX player_game_frag_matrix_2024q2_ix001 on player_game_frag_matrix_2024q2(create_dt); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2024q3 ( - CHECK ( create_dt >= DATE '2024-07-01' AND create_dt < DATE '2024-10-01' ) -) INHERITS (player_game_frag_matrix); - -CREATE INDEX player_game_frag_matrix_2024q3_ix001 on player_game_frag_matrix_2024q3(create_dt); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2024q4 ( - CHECK ( create_dt >= DATE '2024-10-01' AND create_dt < DATE '2025-01-01' ) -) INHERITS (player_game_frag_matrix); - -CREATE INDEX player_game_frag_matrix_2024q4_ix001 on player_game_frag_matrix_2024q4(create_dt); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2025q1 ( - CHECK ( create_dt >= DATE '2025-01-01' AND create_dt < DATE '2025-04-01' ) -) INHERITS (player_game_frag_matrix); - -CREATE INDEX player_game_frag_matrix_2025q1_ix001 on player_game_frag_matrix_2025q1(create_dt); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2025q2 ( - CHECK ( create_dt >= DATE '2025-04-01' AND create_dt < DATE '2025-07-01' ) -) INHERITS (player_game_frag_matrix); - -CREATE INDEX player_game_frag_matrix_2025q2_ix001 on player_game_frag_matrix_2025q2(create_dt); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2025q3 ( - CHECK ( create_dt >= DATE '2025-07-01' AND create_dt < DATE '2025-10-01' ) -) INHERITS (player_game_frag_matrix); - -CREATE INDEX player_game_frag_matrix_2025q3_ix001 on player_game_frag_matrix_2025q3(create_dt); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2025q4 ( - CHECK ( create_dt >= DATE '2025-10-01' AND create_dt < DATE '2026-01-01' ) -) INHERITS (player_game_frag_matrix); - -CREATE INDEX player_game_frag_matrix_2025q4_ix001 on player_game_frag_matrix_2025q4(create_dt); - diff --git a/tables/player_game_nonparticipants.tab b/tables/player_game_nonparticipants.tab deleted file mode 100755 index 07b0802..0000000 --- a/tables/player_game_nonparticipants.tab +++ /dev/null @@ -1,196 +0,0 @@ -CREATE TABLE xonstat.player_game_nonparticipants -( - player_game_nonparticipants_id bigserial NOT NULL, - player_id integer NOT NULL, - game_id bigint NOT NULL, - status character varying(30) NOT NULL, - nick character varying(128), - stripped_nick character varying(128), - alivetime interval, - score integer, - create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'), - CONSTRAINT player_game_nonparticipants_pk PRIMARY KEY (player_game_nonparticipants_id), - CONSTRAINT player_game_nonparticipants_fk001 FOREIGN KEY (player_id) - REFERENCES xonstat.players (player_id) MATCH SIMPLE - ON UPDATE NO ACTION ON DELETE NO ACTION, - CONSTRAINT player_game_nonparticipants_fk002 FOREIGN KEY (game_id) - REFERENCES xonstat.games (game_id) MATCH SIMPLE - ON UPDATE NO ACTION ON DELETE NO ACTION -) -WITH ( - OIDS=FALSE -); - -CREATE INDEX player_game_nonparticipant_ix01 on player_game_nonparticipants(create_dt); -CREATE INDEX player_game_nonparticipant_ix02 on player_game_nonparticipants(game_id); -CREATE INDEX player_game_nonparticipant_ix03 on player_game_nonparticipants(player_id); -ALTER TABLE xonstat.player_game_nonparticipants OWNER TO xonstat; - -CREATE TABLE IF NOT EXISTS xonstat.player_game_nonparticipants_2020q4 ( - CHECK ( create_dt >= DATE '2020-10-01' AND create_dt < DATE '2021-01-01' ) -) INHERITS (player_game_nonparticipants); - -CREATE INDEX player_game_nonparticipants_2020q4_ix001 on player_game_nonparticipants_2020q4(create_dt); -CREATE INDEX player_game_nonparticipants_2020q4_ix002 on player_game_nonparticipants_2020q4(game_id); -CREATE INDEX player_game_nonparticipants_2020q4_ix003 on player_game_nonparticipants_2020q4(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_nonparticipants_2021q1 ( - CHECK ( create_dt >= DATE '2021-01-01' AND create_dt < DATE '2021-04-01' ) -) INHERITS (player_game_nonparticipants); - -CREATE INDEX player_game_nonparticipants_2021q1_ix001 on player_game_nonparticipants_2021q1(create_dt); -CREATE INDEX player_game_nonparticipants_2021q1_ix002 on player_game_nonparticipants_2021q1(game_id); -CREATE INDEX player_game_nonparticipants_2021q1_ix003 on player_game_nonparticipants_2021q1(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_nonparticipants_2021q2 ( - CHECK ( create_dt >= DATE '2021-04-01' AND create_dt < DATE '2021-07-01' ) -) INHERITS (player_game_nonparticipants); - -CREATE INDEX player_game_nonparticipants_2021q2_ix001 on player_game_nonparticipants_2021q2(create_dt); -CREATE INDEX player_game_nonparticipants_2021q2_ix002 on player_game_nonparticipants_2021q2(game_id); -CREATE INDEX player_game_nonparticipants_2021q2_ix003 on player_game_nonparticipants_2021q2(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_nonparticipants_2021q3 ( - CHECK ( create_dt >= DATE '2021-07-01' AND create_dt < DATE '2021-10-01' ) -) INHERITS (player_game_nonparticipants); - -CREATE INDEX player_game_nonparticipants_2021q3_ix001 on player_game_nonparticipants_2021q3(create_dt); -CREATE INDEX player_game_nonparticipants_2021q3_ix002 on player_game_nonparticipants_2021q3(game_id); -CREATE INDEX player_game_nonparticipants_2021q3_ix003 on player_game_nonparticipants_2021q3(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_nonparticipants_2021q4 ( - CHECK ( create_dt >= DATE '2021-10-01' AND create_dt < DATE '2022-01-01' ) -) INHERITS (player_game_nonparticipants); - -CREATE INDEX player_game_nonparticipants_2021q4_ix001 on player_game_nonparticipants_2021q4(create_dt); -CREATE INDEX player_game_nonparticipants_2021q4_ix002 on player_game_nonparticipants_2021q4(game_id); -CREATE INDEX player_game_nonparticipants_2021q4_ix003 on player_game_nonparticipants_2021q4(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_nonparticipants_2022q1 ( - CHECK ( create_dt >= DATE '2022-01-01' AND create_dt < DATE '2022-04-01' ) -) INHERITS (player_game_nonparticipants); - -CREATE INDEX player_game_nonparticipants_2022q1_ix001 on player_game_nonparticipants_2022q1(create_dt); -CREATE INDEX player_game_nonparticipants_2022q1_ix002 on player_game_nonparticipants_2022q1(game_id); -CREATE INDEX player_game_nonparticipants_2022q1_ix003 on player_game_nonparticipants_2022q1(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_nonparticipants_2022q2 ( - CHECK ( create_dt >= DATE '2022-04-01' AND create_dt < DATE '2022-07-01' ) -) INHERITS (player_game_nonparticipants); - -CREATE INDEX player_game_nonparticipants_2022q2_ix001 on player_game_nonparticipants_2022q2(create_dt); -CREATE INDEX player_game_nonparticipants_2022q2_ix002 on player_game_nonparticipants_2022q2(game_id); -CREATE INDEX player_game_nonparticipants_2022q2_ix003 on player_game_nonparticipants_2022q2(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_nonparticipants_2022q3 ( - CHECK ( create_dt >= DATE '2022-07-01' AND create_dt < DATE '2022-10-01' ) -) INHERITS (player_game_nonparticipants); - -CREATE INDEX player_game_nonparticipants_2022q3_ix001 on player_game_nonparticipants_2022q3(create_dt); -CREATE INDEX player_game_nonparticipants_2022q3_ix002 on player_game_nonparticipants_2022q3(game_id); -CREATE INDEX player_game_nonparticipants_2022q3_ix003 on player_game_nonparticipants_2022q3(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_nonparticipants_2022q4 ( - CHECK ( create_dt >= DATE '2022-10-01' AND create_dt < DATE '2023-01-01' ) -) INHERITS (player_game_nonparticipants); - -CREATE INDEX player_game_nonparticipants_2022q4_ix001 on player_game_nonparticipants_2022q4(create_dt); -CREATE INDEX player_game_nonparticipants_2022q4_ix002 on player_game_nonparticipants_2022q4(game_id); -CREATE INDEX player_game_nonparticipants_2022q4_ix003 on player_game_nonparticipants_2022q4(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_nonparticipants_2023q1 ( - CHECK ( create_dt >= DATE '2023-01-01' AND create_dt < DATE '2023-04-01' ) -) INHERITS (player_game_nonparticipants); - -CREATE INDEX player_game_nonparticipants_2023q1_ix001 on player_game_nonparticipants_2023q1(create_dt); -CREATE INDEX player_game_nonparticipants_2023q1_ix002 on player_game_nonparticipants_2023q1(game_id); -CREATE INDEX player_game_nonparticipants_2023q1_ix003 on player_game_nonparticipants_2023q1(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_nonparticipants_2023q2 ( - CHECK ( create_dt >= DATE '2023-04-01' AND create_dt < DATE '2023-07-01' ) -) INHERITS (player_game_nonparticipants); - -CREATE INDEX player_game_nonparticipants_2023q2_ix001 on player_game_nonparticipants_2023q2(create_dt); -CREATE INDEX player_game_nonparticipants_2023q2_ix002 on player_game_nonparticipants_2023q2(game_id); -CREATE INDEX player_game_nonparticipants_2023q2_ix003 on player_game_nonparticipants_2023q2(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_nonparticipants_2023q3 ( - CHECK ( create_dt >= DATE '2023-07-01' AND create_dt < DATE '2023-10-01' ) -) INHERITS (player_game_nonparticipants); - -CREATE INDEX player_game_nonparticipants_2023q3_ix001 on player_game_nonparticipants_2023q3(create_dt); -CREATE INDEX player_game_nonparticipants_2023q3_ix002 on player_game_nonparticipants_2023q3(game_id); -CREATE INDEX player_game_nonparticipants_2023q3_ix003 on player_game_nonparticipants_2023q3(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_nonparticipants_2023q4 ( - CHECK ( create_dt >= DATE '2023-10-01' AND create_dt < DATE '2024-01-01' ) -) INHERITS (player_game_nonparticipants); - -CREATE INDEX player_game_nonparticipants_2023q4_ix001 on player_game_nonparticipants_2023q4(create_dt); -CREATE INDEX player_game_nonparticipants_2023q4_ix002 on player_game_nonparticipants_2023q4(game_id); -CREATE INDEX player_game_nonparticipants_2023q4_ix003 on player_game_nonparticipants_2023q4(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_nonparticipants_2024q1 ( - CHECK ( create_dt >= DATE '2024-01-01' AND create_dt < DATE '2024-04-01' ) -) INHERITS (player_game_nonparticipants); - -CREATE INDEX player_game_nonparticipants_2024q1_ix001 on player_game_nonparticipants_2024q1(create_dt); -CREATE INDEX player_game_nonparticipants_2024q1_ix002 on player_game_nonparticipants_2024q1(game_id); -CREATE INDEX player_game_nonparticipants_2024q1_ix003 on player_game_nonparticipants_2024q1(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_nonparticipants_2024q2 ( - CHECK ( create_dt >= DATE '2024-04-01' AND create_dt < DATE '2024-07-01' ) -) INHERITS (player_game_nonparticipants); - -CREATE INDEX player_game_nonparticipants_2024q2_ix001 on player_game_nonparticipants_2024q2(create_dt); -CREATE INDEX player_game_nonparticipants_2024q2_ix002 on player_game_nonparticipants_2024q2(game_id); -CREATE INDEX player_game_nonparticipants_2024q2_ix003 on player_game_nonparticipants_2024q2(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_nonparticipants_2024q3 ( - CHECK ( create_dt >= DATE '2024-07-01' AND create_dt < DATE '2024-10-01' ) -) INHERITS (player_game_nonparticipants); - -CREATE INDEX player_game_nonparticipants_2024q3_ix001 on player_game_nonparticipants_2024q3(create_dt); -CREATE INDEX player_game_nonparticipants_2024q3_ix002 on player_game_nonparticipants_2024q3(game_id); -CREATE INDEX player_game_nonparticipants_2024q3_ix003 on player_game_nonparticipants_2024q3(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_nonparticipants_2024q4 ( - CHECK ( create_dt >= DATE '2024-10-01' AND create_dt < DATE '2025-01-01' ) -) INHERITS (player_game_nonparticipants); - -CREATE INDEX player_game_nonparticipants_2024q4_ix001 on player_game_nonparticipants_2024q4(create_dt); -CREATE INDEX player_game_nonparticipants_2024q4_ix002 on player_game_nonparticipants_2024q4(game_id); -CREATE INDEX player_game_nonparticipants_2024q4_ix003 on player_game_nonparticipants_2024q4(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_nonparticipants_2025q1 ( - CHECK ( create_dt >= DATE '2025-01-01' AND create_dt < DATE '2025-04-01' ) -) INHERITS (player_game_nonparticipants); - -CREATE INDEX player_game_nonparticipants_2025q1_ix001 on player_game_nonparticipants_2025q1(create_dt); -CREATE INDEX player_game_nonparticipants_2025q1_ix002 on player_game_nonparticipants_2025q1(game_id); -CREATE INDEX player_game_nonparticipants_2025q1_ix003 on player_game_nonparticipants_2025q1(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_nonparticipants_2025q2 ( - CHECK ( create_dt >= DATE '2025-04-01' AND create_dt < DATE '2025-07-01' ) -) INHERITS (player_game_nonparticipants); - -CREATE INDEX player_game_nonparticipants_2025q2_ix001 on player_game_nonparticipants_2025q2(create_dt); -CREATE INDEX player_game_nonparticipants_2025q2_ix002 on player_game_nonparticipants_2025q2(game_id); -CREATE INDEX player_game_nonparticipants_2025q2_ix003 on player_game_nonparticipants_2025q2(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_nonparticipants_2025q3 ( - CHECK ( create_dt >= DATE '2025-07-01' AND create_dt < DATE '2025-10-01' ) -) INHERITS (player_game_nonparticipants); - -CREATE INDEX player_game_nonparticipants_2025q3_ix001 on player_game_nonparticipants_2025q3(create_dt); -CREATE INDEX player_game_nonparticipants_2025q3_ix002 on player_game_nonparticipants_2025q3(game_id); -CREATE INDEX player_game_nonparticipants_2025q3_ix003 on player_game_nonparticipants_2025q3(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_nonparticipants_2025q4 ( - CHECK ( create_dt >= DATE '2025-10-01' AND create_dt < DATE '2026-01-01' ) -) INHERITS (player_game_nonparticipants); - -CREATE INDEX player_game_nonparticipants_2025q4_ix001 on player_game_nonparticipants_2025q4(create_dt); -CREATE INDEX player_game_nonparticipants_2025q4_ix002 on player_game_nonparticipants_2025q4(game_id); -CREATE INDEX player_game_nonparticipants_2025q4_ix003 on player_game_nonparticipants_2025q4(player_id); - diff --git a/tables/player_game_stats.tab b/tables/player_game_stats.tab deleted file mode 100755 index ee937ed..0000000 --- a/tables/player_game_stats.tab +++ /dev/null @@ -1,434 +0,0 @@ -CREATE TABLE xonstat.player_game_stats -( - player_game_stat_id bigserial NOT NULL, - player_id integer NOT NULL, - game_id bigint NOT NULL, - nick character varying(128), - stripped_nick character varying(128), - team integer, - "rank" integer, - alivetime interval, - kills integer, - deaths integer, - suicides integer, - score integer, - "time" interval, - captures integer, - pickups integer, - drops integer, - "returns" integer, - collects integer, - destroys integer, - pushes integer, - carrier_frags integer, - elo_delta numeric, - fastest interval, - avg_latency numeric, - teamrank integer, - scoreboardpos integer, - laps integer, - revivals integer, - lives integer, - create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'), - CONSTRAINT player_game_stats_pk PRIMARY KEY (player_game_stat_id), - CONSTRAINT player_game_stats_fk001 FOREIGN KEY (player_id) - REFERENCES xonstat.players (player_id) MATCH SIMPLE - ON UPDATE NO ACTION ON DELETE NO ACTION, - CONSTRAINT player_game_stats_fk002 FOREIGN KEY (game_id) - REFERENCES xonstat.games (game_id) MATCH SIMPLE - ON UPDATE NO ACTION ON DELETE NO ACTION -) -WITH ( - OIDS=FALSE -); - -CREATE INDEX player_game_stats_ix01 on player_game_stats(create_dt); -CREATE INDEX player_game_stats_ix02 on player_game_stats(game_id); -CREATE INDEX player_game_stats_ix03 on player_game_stats(player_id); -ALTER TABLE xonstat.player_game_stats OWNER TO xonstat; - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2014q1 ( - CHECK ( create_dt >= DATE '2014-01-01' AND create_dt < DATE '2014-04-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2014q1_ix001 on player_game_stats_2014q1(create_dt); -CREATE INDEX player_game_stats_2014q1_ix002 on player_game_stats_2014q1(game_id); -CREATE INDEX player_game_stats_2014q1_ix003 on player_game_stats_2014q1(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2014q2 ( - CHECK ( create_dt >= DATE '2014-04-01' AND create_dt < DATE '2014-07-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2014q2_ix001 on player_game_stats_2014q2(create_dt); -CREATE INDEX player_game_stats_2014q2_ix002 on player_game_stats_2014q2(game_id); -CREATE INDEX player_game_stats_2014q2_ix003 on player_game_stats_2014q2(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2014q3 ( - CHECK ( create_dt >= DATE '2014-07-01' AND create_dt < DATE '2014-10-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2014q3_ix001 on player_game_stats_2014q3(create_dt); -CREATE INDEX player_game_stats_2014q3_ix002 on player_game_stats_2014q3(game_id); -CREATE INDEX player_game_stats_2014q3_ix003 on player_game_stats_2014q3(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2014q4 ( - CHECK ( create_dt >= DATE '2014-10-01' AND create_dt < DATE '2015-01-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2014q4_ix001 on player_game_stats_2014q4(create_dt); -CREATE INDEX player_game_stats_2014q4_ix002 on player_game_stats_2014q4(game_id); -CREATE INDEX player_game_stats_2014q4_ix003 on player_game_stats_2014q4(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2015q1 ( - CHECK ( create_dt >= DATE '2015-01-01' AND create_dt < DATE '2015-04-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2015q1_ix001 on player_game_stats_2015q1(create_dt); -CREATE INDEX player_game_stats_2015q1_ix002 on player_game_stats_2015q1(game_id); -CREATE INDEX player_game_stats_2015q1_ix003 on player_game_stats_2015q1(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2015q2 ( - CHECK ( create_dt >= DATE '2015-04-01' AND create_dt < DATE '2015-07-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2015q2_ix001 on player_game_stats_2015q2(create_dt); -CREATE INDEX player_game_stats_2015q2_ix002 on player_game_stats_2015q2(game_id); -CREATE INDEX player_game_stats_2015q2_ix003 on player_game_stats_2015q2(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2015q3 ( - CHECK ( create_dt >= DATE '2015-07-01' AND create_dt < DATE '2015-10-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2015q3_ix001 on player_game_stats_2015q3(create_dt); -CREATE INDEX player_game_stats_2015q3_ix002 on player_game_stats_2015q3(game_id); -CREATE INDEX player_game_stats_2015q3_ix003 on player_game_stats_2015q3(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2015q4 ( - CHECK ( create_dt >= DATE '2015-10-01' AND create_dt < DATE '2016-01-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2015q4_ix001 on player_game_stats_2015q4(create_dt); -CREATE INDEX player_game_stats_2015q4_ix002 on player_game_stats_2015q4(game_id); -CREATE INDEX player_game_stats_2015q4_ix003 on player_game_stats_2015q4(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2016q1 ( - CHECK ( create_dt >= DATE '2016-01-01' AND create_dt < DATE '2016-04-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2016q1_ix001 on player_game_stats_2016q1(create_dt); -CREATE INDEX player_game_stats_2016q1_ix002 on player_game_stats_2016q1(game_id); -CREATE INDEX player_game_stats_2016q1_ix003 on player_game_stats_2016q1(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2016q2 ( - CHECK ( create_dt >= DATE '2016-04-01' AND create_dt < DATE '2016-07-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2016q2_ix001 on player_game_stats_2016q2(create_dt); -CREATE INDEX player_game_stats_2016q2_ix002 on player_game_stats_2016q2(game_id); -CREATE INDEX player_game_stats_2016q2_ix003 on player_game_stats_2016q2(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2016q3 ( - CHECK ( create_dt >= DATE '2016-07-01' AND create_dt < DATE '2016-10-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2016q3_ix001 on player_game_stats_2016q3(create_dt); -CREATE INDEX player_game_stats_2016q3_ix002 on player_game_stats_2016q3(game_id); -CREATE INDEX player_game_stats_2016q3_ix003 on player_game_stats_2016q3(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2016q4 ( - CHECK ( create_dt >= DATE '2016-10-01' AND create_dt < DATE '2017-01-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2016q4_ix001 on player_game_stats_2016q4(create_dt); -CREATE INDEX player_game_stats_2016q4_ix002 on player_game_stats_2016q4(game_id); -CREATE INDEX player_game_stats_2016q4_ix003 on player_game_stats_2016q4(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2017q1 ( - CHECK ( create_dt >= DATE '2017-01-01' AND create_dt < DATE '2017-04-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2017q1_ix001 on player_game_stats_2017q1(create_dt); -CREATE INDEX player_game_stats_2017q1_ix002 on player_game_stats_2017q1(game_id); -CREATE INDEX player_game_stats_2017q1_ix003 on player_game_stats_2017q1(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2017q2 ( - CHECK ( create_dt >= DATE '2017-04-01' AND create_dt < DATE '2017-07-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2017q2_ix001 on player_game_stats_2017q2(create_dt); -CREATE INDEX player_game_stats_2017q2_ix002 on player_game_stats_2017q2(game_id); -CREATE INDEX player_game_stats_2017q2_ix003 on player_game_stats_2017q2(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2017q3 ( - CHECK ( create_dt >= DATE '2017-07-01' AND create_dt < DATE '2017-10-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2017q3_ix001 on player_game_stats_2017q3(create_dt); -CREATE INDEX player_game_stats_2017q3_ix002 on player_game_stats_2017q3(game_id); -CREATE INDEX player_game_stats_2017q3_ix003 on player_game_stats_2017q3(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2017q4 ( - CHECK ( create_dt >= DATE '2017-10-01' AND create_dt < DATE '2018-01-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2017q4_ix001 on player_game_stats_2017q4(create_dt); -CREATE INDEX player_game_stats_2017q4_ix002 on player_game_stats_2017q4(game_id); -CREATE INDEX player_game_stats_2017q4_ix003 on player_game_stats_2017q4(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2018q1 ( - CHECK ( create_dt >= DATE '2018-01-01' AND create_dt < DATE '2018-04-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2018q1_ix001 on player_game_stats_2018q1(create_dt); -CREATE INDEX player_game_stats_2018q1_ix002 on player_game_stats_2018q1(game_id); -CREATE INDEX player_game_stats_2018q1_ix003 on player_game_stats_2018q1(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2018q2 ( - CHECK ( create_dt >= DATE '2018-04-01' AND create_dt < DATE '2018-07-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2018q2_ix001 on player_game_stats_2018q2(create_dt); -CREATE INDEX player_game_stats_2018q2_ix002 on player_game_stats_2018q2(game_id); -CREATE INDEX player_game_stats_2018q2_ix003 on player_game_stats_2018q2(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2018q3 ( - CHECK ( create_dt >= DATE '2018-07-01' AND create_dt < DATE '2018-10-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2018q3_ix001 on player_game_stats_2018q3(create_dt); -CREATE INDEX player_game_stats_2018q3_ix002 on player_game_stats_2018q3(game_id); -CREATE INDEX player_game_stats_2018q3_ix003 on player_game_stats_2018q3(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2018q4 ( - CHECK ( create_dt >= DATE '2018-10-01' AND create_dt < DATE '2019-01-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2018q4_ix001 on player_game_stats_2018q4(create_dt); -CREATE INDEX player_game_stats_2018q4_ix002 on player_game_stats_2018q4(game_id); -CREATE INDEX player_game_stats_2018q4_ix003 on player_game_stats_2018q4(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2019q1 ( - CHECK ( create_dt >= DATE '2019-01-01' AND create_dt < DATE '2019-04-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2019q1_ix001 on player_game_stats_2019q1(create_dt); -CREATE INDEX player_game_stats_2019q1_ix002 on player_game_stats_2019q1(game_id); -CREATE INDEX player_game_stats_2019q1_ix003 on player_game_stats_2019q1(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2019q2 ( - CHECK ( create_dt >= DATE '2019-04-01' AND create_dt < DATE '2019-07-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2019q2_ix001 on player_game_stats_2019q2(create_dt); -CREATE INDEX player_game_stats_2019q2_ix002 on player_game_stats_2019q2(game_id); -CREATE INDEX player_game_stats_2019q2_ix003 on player_game_stats_2019q2(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2019q3 ( - CHECK ( create_dt >= DATE '2019-07-01' AND create_dt < DATE '2019-10-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2019q3_ix001 on player_game_stats_2019q3(create_dt); -CREATE INDEX player_game_stats_2019q3_ix002 on player_game_stats_2019q3(game_id); -CREATE INDEX player_game_stats_2019q3_ix003 on player_game_stats_2019q3(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2019q4 ( - CHECK ( create_dt >= DATE '2019-10-01' AND create_dt < DATE '2020-01-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2019q4_ix001 on player_game_stats_2019q4(create_dt); -CREATE INDEX player_game_stats_2019q4_ix002 on player_game_stats_2019q4(game_id); -CREATE INDEX player_game_stats_2019q4_ix003 on player_game_stats_2019q4(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2020q1 ( - CHECK ( create_dt >= DATE '2020-01-01' AND create_dt < DATE '2020-04-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2020q1_ix001 on player_game_stats_2020q1(create_dt); -CREATE INDEX player_game_stats_2020q1_ix002 on player_game_stats_2020q1(game_id); -CREATE INDEX player_game_stats_2020q1_ix003 on player_game_stats_2020q1(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2020q2 ( - CHECK ( create_dt >= DATE '2020-04-01' AND create_dt < DATE '2020-07-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2020q2_ix001 on player_game_stats_2020q2(create_dt); -CREATE INDEX player_game_stats_2020q2_ix002 on player_game_stats_2020q2(game_id); -CREATE INDEX player_game_stats_2020q2_ix003 on player_game_stats_2020q2(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2020q3 ( - CHECK ( create_dt >= DATE '2020-07-01' AND create_dt < DATE '2020-10-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2020q3_ix001 on player_game_stats_2020q3(create_dt); -CREATE INDEX player_game_stats_2020q3_ix002 on player_game_stats_2020q3(game_id); -CREATE INDEX player_game_stats_2020q3_ix003 on player_game_stats_2020q3(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2020q4 ( - CHECK ( create_dt >= DATE '2020-10-01' AND create_dt < DATE '2021-01-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2020q4_ix001 on player_game_stats_2020q4(create_dt); -CREATE INDEX player_game_stats_2020q4_ix002 on player_game_stats_2020q4(game_id); -CREATE INDEX player_game_stats_2020q4_ix003 on player_game_stats_2020q4(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2021q1 ( - CHECK ( create_dt >= DATE '2021-01-01' AND create_dt < DATE '2021-04-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2021q1_ix001 on player_game_stats_2021q1(create_dt); -CREATE INDEX player_game_stats_2021q1_ix002 on player_game_stats_2021q1(game_id); -CREATE INDEX player_game_stats_2021q1_ix003 on player_game_stats_2021q1(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2021q2 ( - CHECK ( create_dt >= DATE '2021-04-01' AND create_dt < DATE '2021-07-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2021q2_ix001 on player_game_stats_2021q2(create_dt); -CREATE INDEX player_game_stats_2021q2_ix002 on player_game_stats_2021q2(game_id); -CREATE INDEX player_game_stats_2021q2_ix003 on player_game_stats_2021q2(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2021q3 ( - CHECK ( create_dt >= DATE '2021-07-01' AND create_dt < DATE '2021-10-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2021q3_ix001 on player_game_stats_2021q3(create_dt); -CREATE INDEX player_game_stats_2021q3_ix002 on player_game_stats_2021q3(game_id); -CREATE INDEX player_game_stats_2021q3_ix003 on player_game_stats_2021q3(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2021q4 ( - CHECK ( create_dt >= DATE '2021-10-01' AND create_dt < DATE '2022-01-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2021q4_ix001 on player_game_stats_2021q4(create_dt); -CREATE INDEX player_game_stats_2021q4_ix002 on player_game_stats_2021q4(game_id); -CREATE INDEX player_game_stats_2021q4_ix003 on player_game_stats_2021q4(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2022q1 ( - CHECK ( create_dt >= DATE '2022-01-01' AND create_dt < DATE '2022-04-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2022q1_ix001 on player_game_stats_2022q1(create_dt); -CREATE INDEX player_game_stats_2022q1_ix002 on player_game_stats_2022q1(game_id); -CREATE INDEX player_game_stats_2022q1_ix003 on player_game_stats_2022q1(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2022q2 ( - CHECK ( create_dt >= DATE '2022-04-01' AND create_dt < DATE '2022-07-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2022q2_ix001 on player_game_stats_2022q2(create_dt); -CREATE INDEX player_game_stats_2022q2_ix002 on player_game_stats_2022q2(game_id); -CREATE INDEX player_game_stats_2022q2_ix003 on player_game_stats_2022q2(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2022q3 ( - CHECK ( create_dt >= DATE '2022-07-01' AND create_dt < DATE '2022-10-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2022q3_ix001 on player_game_stats_2022q3(create_dt); -CREATE INDEX player_game_stats_2022q3_ix002 on player_game_stats_2022q3(game_id); -CREATE INDEX player_game_stats_2022q3_ix003 on player_game_stats_2022q3(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2022q4 ( - CHECK ( create_dt >= DATE '2022-10-01' AND create_dt < DATE '2023-01-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2022q4_ix001 on player_game_stats_2022q4(create_dt); -CREATE INDEX player_game_stats_2022q4_ix002 on player_game_stats_2022q4(game_id); -CREATE INDEX player_game_stats_2022q4_ix003 on player_game_stats_2022q4(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2023q1 ( - CHECK ( create_dt >= DATE '2023-01-01' AND create_dt < DATE '2023-04-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2023q1_ix001 on player_game_stats_2023q1(create_dt); -CREATE INDEX player_game_stats_2023q1_ix002 on player_game_stats_2023q1(game_id); -CREATE INDEX player_game_stats_2023q1_ix003 on player_game_stats_2023q1(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2023q2 ( - CHECK ( create_dt >= DATE '2023-04-01' AND create_dt < DATE '2023-07-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2023q2_ix001 on player_game_stats_2023q2(create_dt); -CREATE INDEX player_game_stats_2023q2_ix002 on player_game_stats_2023q2(game_id); -CREATE INDEX player_game_stats_2023q2_ix003 on player_game_stats_2023q2(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2023q3 ( - CHECK ( create_dt >= DATE '2023-07-01' AND create_dt < DATE '2023-10-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2023q3_ix001 on player_game_stats_2023q3(create_dt); -CREATE INDEX player_game_stats_2023q3_ix002 on player_game_stats_2023q3(game_id); -CREATE INDEX player_game_stats_2023q3_ix003 on player_game_stats_2023q3(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2023q4 ( - CHECK ( create_dt >= DATE '2023-10-01' AND create_dt < DATE '2024-01-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2023q4_ix001 on player_game_stats_2023q4(create_dt); -CREATE INDEX player_game_stats_2023q4_ix002 on player_game_stats_2023q4(game_id); -CREATE INDEX player_game_stats_2023q4_ix003 on player_game_stats_2023q4(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2024q1 ( - CHECK ( create_dt >= DATE '2024-01-01' AND create_dt < DATE '2024-04-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2024q1_ix001 on player_game_stats_2024q1(create_dt); -CREATE INDEX player_game_stats_2024q1_ix002 on player_game_stats_2024q1(game_id); -CREATE INDEX player_game_stats_2024q1_ix003 on player_game_stats_2024q1(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2024q2 ( - CHECK ( create_dt >= DATE '2024-04-01' AND create_dt < DATE '2024-07-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2024q2_ix001 on player_game_stats_2024q2(create_dt); -CREATE INDEX player_game_stats_2024q2_ix002 on player_game_stats_2024q2(game_id); -CREATE INDEX player_game_stats_2024q2_ix003 on player_game_stats_2024q2(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2024q3 ( - CHECK ( create_dt >= DATE '2024-07-01' AND create_dt < DATE '2024-10-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2024q3_ix001 on player_game_stats_2024q3(create_dt); -CREATE INDEX player_game_stats_2024q3_ix002 on player_game_stats_2024q3(game_id); -CREATE INDEX player_game_stats_2024q3_ix003 on player_game_stats_2024q3(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2024q4 ( - CHECK ( create_dt >= DATE '2024-10-01' AND create_dt < DATE '2025-01-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2024q4_ix001 on player_game_stats_2024q4(create_dt); -CREATE INDEX player_game_stats_2024q4_ix002 on player_game_stats_2024q4(game_id); -CREATE INDEX player_game_stats_2024q4_ix003 on player_game_stats_2024q4(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2025q1 ( - CHECK ( create_dt >= DATE '2025-01-01' AND create_dt < DATE '2025-04-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2025q1_ix001 on player_game_stats_2025q1(create_dt); -CREATE INDEX player_game_stats_2025q1_ix002 on player_game_stats_2025q1(game_id); -CREATE INDEX player_game_stats_2025q1_ix003 on player_game_stats_2025q1(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2025q2 ( - CHECK ( create_dt >= DATE '2025-04-01' AND create_dt < DATE '2025-07-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2025q2_ix001 on player_game_stats_2025q2(create_dt); -CREATE INDEX player_game_stats_2025q2_ix002 on player_game_stats_2025q2(game_id); -CREATE INDEX player_game_stats_2025q2_ix003 on player_game_stats_2025q2(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2025q3 ( - CHECK ( create_dt >= DATE '2025-07-01' AND create_dt < DATE '2025-10-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2025q3_ix001 on player_game_stats_2025q3(create_dt); -CREATE INDEX player_game_stats_2025q3_ix002 on player_game_stats_2025q3(game_id); -CREATE INDEX player_game_stats_2025q3_ix003 on player_game_stats_2025q3(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2025q4 ( - CHECK ( create_dt >= DATE '2025-10-01' AND create_dt < DATE '2026-01-01' ) -) INHERITS (player_game_stats); - -CREATE INDEX player_game_stats_2025q4_ix001 on player_game_stats_2025q4(create_dt); -CREATE INDEX player_game_stats_2025q4_ix002 on player_game_stats_2025q4(game_id); -CREATE INDEX player_game_stats_2025q4_ix003 on player_game_stats_2025q4(player_id); - - diff --git a/tables/player_groups.tab b/tables/player_groups.tab deleted file mode 100755 index d401f39..0000000 --- a/tables/player_groups.tab +++ /dev/null @@ -1,14 +0,0 @@ -CREATE TABLE xonstat.player_groups -( - player_id integer NOT NULL, - group_name character varying(30) NOT NULL, - create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'), - CONSTRAINT player_groups_pk PRIMARY KEY (player_id, group_name), - CONSTRAINT player_groups_fk001 FOREIGN KEY (player_id) - REFERENCES xonstat.players (player_id) MATCH SIMPLE - ON UPDATE NO ACTION ON DELETE NO ACTION -) -WITH ( - OIDS=FALSE -); -ALTER TABLE xonstat.player_groups OWNER TO xonstat; diff --git a/tables/player_ladder_ranks.tab b/tables/player_ladder_ranks.tab deleted file mode 100755 index ec8b1a0..0000000 --- a/tables/player_ladder_ranks.tab +++ /dev/null @@ -1,24 +0,0 @@ -CREATE TABLE xonstat.player_ladder_ranks -( - player_ladder_rank_id serial NOT NULL, - player_id integer NOT NULL, - ladder_cd integer NOT NULL, - points integer NOT NULL default 0, - rank integer NOT NULL default 1, - games integer NOT NULL default 0, - wins integer NOT NULL default 0, - active_ind boolean NOT NULL default true, - create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'), - CONSTRAINT player_ladder_ranks_pk PRIMARY KEY (player_ladder_rank_id), - CONSTRAINT player_ladder_ranks_uk01 UNIQUE (player_id, ladder_cd), - CONSTRAINT player_ladder_ranks_fk01 FOREIGN KEY (player_id) - REFERENCES xonstat.players (player_id) MATCH SIMPLE - ON UPDATE NO ACTION ON DELETE NO ACTION, - CONSTRAINT player_ladder_ranks_fk02 FOREIGN KEY (ladder_cd) - REFERENCES xonstat.cd_ladder (ladder_cd) MATCH SIMPLE - ON UPDATE NO ACTION ON DELETE NO ACTION -) -WITH ( - OIDS=FALSE -); -ALTER TABLE xonstat.player_ladder_ranks OWNER TO xonstat; diff --git a/tables/player_map_captimes.tab b/tables/player_map_captimes.tab deleted file mode 100755 index 422702a..0000000 --- a/tables/player_map_captimes.tab +++ /dev/null @@ -1,29 +0,0 @@ -CREATE TABLE xonstat.player_map_captimes -( - player_map_captime_id serial NOT NULL, - player_id integer NOT NULL, - map_id integer NOT NULL, - game_id bigint NOT NULL, - fastest_cap interval NOT NULL, - mod character varying(64), - create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'), - CONSTRAINT player_map_captimes_pk PRIMARY KEY (player_map_captime_id), - CONSTRAINT player_map_captimes_uk01 UNIQUE (player_id, map_id, mod), - CONSTRAINT player_map_captimes_fk01 FOREIGN KEY (player_id) - REFERENCES xonstat.players (player_id) MATCH SIMPLE - ON UPDATE NO ACTION ON DELETE NO ACTION, - CONSTRAINT player_map_captimes_fk02 FOREIGN KEY (map_id) - REFERENCES xonstat.maps (map_id) MATCH SIMPLE - ON UPDATE NO ACTION ON DELETE NO ACTION --- I have no idea why this causes an integrity constraint error, --- but it does. Since it is not critical, I'll drop it off for now, --- until I get a clue as to why the error happens. --- , - -- CONSTRAINT player_map_captimes_fk03 FOREIGN KEY (game_id) - -- REFERENCES xonstat.games (game_id) MATCH SIMPLE - -- ON UPDATE NO ACTION ON DELETE NO ACTION -) -WITH ( - OIDS=FALSE -); -ALTER TABLE xonstat.player_map_captimes OWNER TO xonstat; diff --git a/tables/player_medals.tab b/tables/player_medals.tab deleted file mode 100755 index 80440f5..0000000 --- a/tables/player_medals.tab +++ /dev/null @@ -1,17 +0,0 @@ -CREATE TABLE player_medals -( - player_id integer NOT NULL, - place integer NOT NULL, - image character varying(50) NOT NULL, - alt character varying(50) NOT NULL, - create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'), - CONSTRAINT player_medals_pk PRIMARY KEY (player_id, image), - CONSTRAINT player_medals_fk01 FOREIGN KEY (player_id) - REFERENCES players (player_id) MATCH SIMPLE - ON UPDATE NO ACTION ON DELETE NO ACTION -) -WITH ( - OIDS=FALSE -); - -ALTER TABLE player_medals OWNER TO xonstat; diff --git a/tables/player_nicks.tab b/tables/player_nicks.tab deleted file mode 100755 index 6a42088..0000000 --- a/tables/player_nicks.tab +++ /dev/null @@ -1,15 +0,0 @@ -CREATE TABLE xonstat.player_nicks -( - player_id integer NOT NULL, - stripped_nick character varying(128) NOT NULL, - nick character varying(128) NOT NULL, - create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'), - CONSTRAINT player_nicks_pk PRIMARY KEY (player_id, stripped_nick), - CONSTRAINT player_nicks_fk01 FOREIGN KEY (player_id) - REFERENCES xonstat.players (player_id) MATCH SIMPLE - ON UPDATE NO ACTION ON DELETE NO ACTION -) -WITH ( - OIDS=FALSE -); -ALTER TABLE xonstat.player_nicks OWNER TO xonstat; diff --git a/tables/player_ranks.tab b/tables/player_ranks.tab deleted file mode 100755 index a40be2b..0000000 --- a/tables/player_ranks.tab +++ /dev/null @@ -1,21 +0,0 @@ -CREATE TABLE player_ranks -( - player_id integer NOT NULL, - nick character varying(128), - game_type_cd character varying(10) NOT NULL, - category character varying(10) NOT NULL default 'general', - elo numeric NOT NULL, - rank integer NOT NULL, - create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'), - CONSTRAINT player_ranks_pk PRIMARY KEY (player_id, game_type_cd), - CONSTRAINT player_ranks_fk01 FOREIGN KEY (player_id) - REFERENCES players (player_id) MATCH SIMPLE - ON UPDATE NO ACTION ON DELETE NO ACTION, - CONSTRAINT player_ranks_fk02 FOREIGN KEY (game_type_cd) - REFERENCES cd_game_type (game_type_cd) MATCH SIMPLE - ON UPDATE NO ACTION ON DELETE NO ACTION -) -WITH ( - OIDS=FALSE -); -ALTER TABLE player_ranks OWNER TO xonstat; diff --git a/tables/player_ranks_history.tab b/tables/player_ranks_history.tab deleted file mode 100755 index ec6673a..0000000 --- a/tables/player_ranks_history.tab +++ /dev/null @@ -1,14 +0,0 @@ -CREATE TABLE player_ranks_history -( - player_id integer NOT NULL, - nick character varying(128), - game_type_cd character varying(10) NOT NULL, - category character varying(10) NOT NULL default 'general', - elo numeric NOT NULL, - rank integer NOT NULL, - create_dt timestamp without time zone -) -WITH ( - OIDS=FALSE -); -ALTER TABLE player_ranks OWNER TO xonstat; diff --git a/tables/player_skills.tab b/tables/player_skills.tab deleted file mode 100644 index 45d9f87..0000000 --- a/tables/player_skills.tab +++ /dev/null @@ -1,21 +0,0 @@ -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; diff --git a/tables/player_weapon_stats.tab b/tables/player_weapon_stats.tab deleted file mode 100755 index ab041d4..0000000 --- a/tables/player_weapon_stats.tab +++ /dev/null @@ -1,422 +0,0 @@ -CREATE TABLE xonstat.player_weapon_stats -( - player_weapon_stats_id bigserial NOT NULL, - player_id integer NOT NULL, - game_id bigint NOT NULL, - player_game_stat_id bigint NOT NULL, - weapon_cd character varying(15) NOT NULL, - actual integer NOT NULL default 0, - max integer NOT NULL default 0, - hit integer NOT NULL default 0, - fired integer NOT NULL default 0, - frags integer NOT NULL default 0, - create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'), - CONSTRAINT player_weapon_stats_pk PRIMARY KEY (player_weapon_stats_id), - CONSTRAINT player_weapon_stats_fk001 FOREIGN KEY (player_id) - REFERENCES xonstat.players (player_id) MATCH SIMPLE - ON UPDATE NO ACTION ON DELETE NO ACTION, - CONSTRAINT player_weapon_stats_fk002 FOREIGN KEY (game_id) - REFERENCES xonstat.games (game_id) MATCH SIMPLE - ON UPDATE NO ACTION ON DELETE NO ACTION, - CONSTRAINT player_weapon_stats_fk003 FOREIGN KEY (weapon_cd) - REFERENCES xonstat.cd_weapon (weapon_cd) MATCH SIMPLE - ON UPDATE NO ACTION ON DELETE NO ACTION, - CONSTRAINT player_weapon_stats_fk004 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 -) -WITH ( - OIDS=FALSE -); - -CREATE INDEX player_weap_stats_ix01 on player_weapon_stats(create_dt); -CREATE INDEX player_weap_stats_ix02 on player_weapon_stats(game_id); -CREATE INDEX player_weap_stats_ix03 on player_weapon_stats(player_id); - -ALTER TABLE xonstat.player_weapon_stats OWNER TO xonstat; - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2014q1 ( - CHECK ( create_dt >= DATE '2014-01-01' AND create_dt < DATE '2014-04-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2014q1_ix001 on player_weapon_stats_2014q1(create_dt); -CREATE INDEX player_weapon_stats_2014q1_ix002 on player_weapon_stats_2014q1(game_id); -CREATE INDEX player_weapon_stats_2014q1_ix003 on player_weapon_stats_2014q1(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2014q2 ( - CHECK ( create_dt >= DATE '2014-04-01' AND create_dt < DATE '2014-07-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2014q2_ix001 on player_weapon_stats_2014q2(create_dt); -CREATE INDEX player_weapon_stats_2014q2_ix002 on player_weapon_stats_2014q2(game_id); -CREATE INDEX player_weapon_stats_2014q2_ix003 on player_weapon_stats_2014q2(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2014q3 ( - CHECK ( create_dt >= DATE '2014-07-01' AND create_dt < DATE '2014-10-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2014q3_ix001 on player_weapon_stats_2014q3(create_dt); -CREATE INDEX player_weapon_stats_2014q3_ix002 on player_weapon_stats_2014q3(game_id); -CREATE INDEX player_weapon_stats_2014q3_ix003 on player_weapon_stats_2014q3(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2014q4 ( - CHECK ( create_dt >= DATE '2014-10-01' AND create_dt < DATE '2015-01-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2014q4_ix001 on player_weapon_stats_2014q4(create_dt); -CREATE INDEX player_weapon_stats_2014q4_ix002 on player_weapon_stats_2014q4(game_id); -CREATE INDEX player_weapon_stats_2014q4_ix003 on player_weapon_stats_2014q4(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2015q1 ( - CHECK ( create_dt >= DATE '2015-01-01' AND create_dt < DATE '2015-04-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2015q1_ix001 on player_weapon_stats_2015q1(create_dt); -CREATE INDEX player_weapon_stats_2015q1_ix002 on player_weapon_stats_2015q1(game_id); -CREATE INDEX player_weapon_stats_2015q1_ix003 on player_weapon_stats_2015q1(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2015q2 ( - CHECK ( create_dt >= DATE '2015-04-01' AND create_dt < DATE '2015-07-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2015q2_ix001 on player_weapon_stats_2015q2(create_dt); -CREATE INDEX player_weapon_stats_2015q2_ix002 on player_weapon_stats_2015q2(game_id); -CREATE INDEX player_weapon_stats_2015q2_ix003 on player_weapon_stats_2015q2(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2015q3 ( - CHECK ( create_dt >= DATE '2015-07-01' AND create_dt < DATE '2015-10-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2015q3_ix001 on player_weapon_stats_2015q3(create_dt); -CREATE INDEX player_weapon_stats_2015q3_ix002 on player_weapon_stats_2015q3(game_id); -CREATE INDEX player_weapon_stats_2015q3_ix003 on player_weapon_stats_2015q3(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2015q4 ( - CHECK ( create_dt >= DATE '2015-10-01' AND create_dt < DATE '2016-01-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2015q4_ix001 on player_weapon_stats_2015q4(create_dt); -CREATE INDEX player_weapon_stats_2015q4_ix002 on player_weapon_stats_2015q4(game_id); -CREATE INDEX player_weapon_stats_2015q4_ix003 on player_weapon_stats_2015q4(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2016q1 ( - CHECK ( create_dt >= DATE '2016-01-01' AND create_dt < DATE '2016-04-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2016q1_ix001 on player_weapon_stats_2016q1(create_dt); -CREATE INDEX player_weapon_stats_2016q1_ix002 on player_weapon_stats_2016q1(game_id); -CREATE INDEX player_weapon_stats_2016q1_ix003 on player_weapon_stats_2016q1(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2016q2 ( - CHECK ( create_dt >= DATE '2016-04-01' AND create_dt < DATE '2016-07-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2016q2_ix001 on player_weapon_stats_2016q2(create_dt); -CREATE INDEX player_weapon_stats_2016q2_ix002 on player_weapon_stats_2016q2(game_id); -CREATE INDEX player_weapon_stats_2016q2_ix003 on player_weapon_stats_2016q2(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2016q3 ( - CHECK ( create_dt >= DATE '2016-07-01' AND create_dt < DATE '2016-10-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2016q3_ix001 on player_weapon_stats_2016q3(create_dt); -CREATE INDEX player_weapon_stats_2016q3_ix002 on player_weapon_stats_2016q3(game_id); -CREATE INDEX player_weapon_stats_2016q3_ix003 on player_weapon_stats_2016q3(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2016q4 ( - CHECK ( create_dt >= DATE '2016-10-01' AND create_dt < DATE '2017-01-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2016q4_ix001 on player_weapon_stats_2016q4(create_dt); -CREATE INDEX player_weapon_stats_2016q4_ix002 on player_weapon_stats_2016q4(game_id); -CREATE INDEX player_weapon_stats_2016q4_ix003 on player_weapon_stats_2016q4(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2017q1 ( - CHECK ( create_dt >= DATE '2017-01-01' AND create_dt < DATE '2017-04-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2017q1_ix001 on player_weapon_stats_2017q1(create_dt); -CREATE INDEX player_weapon_stats_2017q1_ix002 on player_weapon_stats_2017q1(game_id); -CREATE INDEX player_weapon_stats_2017q1_ix003 on player_weapon_stats_2017q1(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2017q2 ( - CHECK ( create_dt >= DATE '2017-04-01' AND create_dt < DATE '2017-07-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2017q2_ix001 on player_weapon_stats_2017q2(create_dt); -CREATE INDEX player_weapon_stats_2017q2_ix002 on player_weapon_stats_2017q2(game_id); -CREATE INDEX player_weapon_stats_2017q2_ix003 on player_weapon_stats_2017q2(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2017q3 ( - CHECK ( create_dt >= DATE '2017-07-01' AND create_dt < DATE '2017-10-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2017q3_ix001 on player_weapon_stats_2017q3(create_dt); -CREATE INDEX player_weapon_stats_2017q3_ix002 on player_weapon_stats_2017q3(game_id); -CREATE INDEX player_weapon_stats_2017q3_ix003 on player_weapon_stats_2017q3(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2017q4 ( - CHECK ( create_dt >= DATE '2017-10-01' AND create_dt < DATE '2018-01-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2017q4_ix001 on player_weapon_stats_2017q4(create_dt); -CREATE INDEX player_weapon_stats_2017q4_ix002 on player_weapon_stats_2017q4(game_id); -CREATE INDEX player_weapon_stats_2017q4_ix003 on player_weapon_stats_2017q4(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2018q1 ( - CHECK ( create_dt >= DATE '2018-01-01' AND create_dt < DATE '2018-04-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2018q1_ix001 on player_weapon_stats_2018q1(create_dt); -CREATE INDEX player_weapon_stats_2018q1_ix002 on player_weapon_stats_2018q1(game_id); -CREATE INDEX player_weapon_stats_2018q1_ix003 on player_weapon_stats_2018q1(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2018q2 ( - CHECK ( create_dt >= DATE '2018-04-01' AND create_dt < DATE '2018-07-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2018q2_ix001 on player_weapon_stats_2018q2(create_dt); -CREATE INDEX player_weapon_stats_2018q2_ix002 on player_weapon_stats_2018q2(game_id); -CREATE INDEX player_weapon_stats_2018q2_ix003 on player_weapon_stats_2018q2(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2018q3 ( - CHECK ( create_dt >= DATE '2018-07-01' AND create_dt < DATE '2018-10-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2018q3_ix001 on player_weapon_stats_2018q3(create_dt); -CREATE INDEX player_weapon_stats_2018q3_ix002 on player_weapon_stats_2018q3(game_id); -CREATE INDEX player_weapon_stats_2018q3_ix003 on player_weapon_stats_2018q3(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2018q4 ( - CHECK ( create_dt >= DATE '2018-10-01' AND create_dt < DATE '2019-01-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2018q4_ix001 on player_weapon_stats_2018q4(create_dt); -CREATE INDEX player_weapon_stats_2018q4_ix002 on player_weapon_stats_2018q4(game_id); -CREATE INDEX player_weapon_stats_2018q4_ix003 on player_weapon_stats_2018q4(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2019q1 ( - CHECK ( create_dt >= DATE '2019-01-01' AND create_dt < DATE '2019-04-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2019q1_ix001 on player_weapon_stats_2019q1(create_dt); -CREATE INDEX player_weapon_stats_2019q1_ix002 on player_weapon_stats_2019q1(game_id); -CREATE INDEX player_weapon_stats_2019q1_ix003 on player_weapon_stats_2019q1(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2019q2 ( - CHECK ( create_dt >= DATE '2019-04-01' AND create_dt < DATE '2019-07-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2019q2_ix001 on player_weapon_stats_2019q2(create_dt); -CREATE INDEX player_weapon_stats_2019q2_ix002 on player_weapon_stats_2019q2(game_id); -CREATE INDEX player_weapon_stats_2019q2_ix003 on player_weapon_stats_2019q2(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2019q3 ( - CHECK ( create_dt >= DATE '2019-07-01' AND create_dt < DATE '2019-10-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2019q3_ix001 on player_weapon_stats_2019q3(create_dt); -CREATE INDEX player_weapon_stats_2019q3_ix002 on player_weapon_stats_2019q3(game_id); -CREATE INDEX player_weapon_stats_2019q3_ix003 on player_weapon_stats_2019q3(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2019q4 ( - CHECK ( create_dt >= DATE '2019-10-01' AND create_dt < DATE '2020-01-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2019q4_ix001 on player_weapon_stats_2019q4(create_dt); -CREATE INDEX player_weapon_stats_2019q4_ix002 on player_weapon_stats_2019q4(game_id); -CREATE INDEX player_weapon_stats_2019q4_ix003 on player_weapon_stats_2019q4(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2020q1 ( - CHECK ( create_dt >= DATE '2020-01-01' AND create_dt < DATE '2020-04-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2020q1_ix001 on player_weapon_stats_2020q1(create_dt); -CREATE INDEX player_weapon_stats_2020q1_ix002 on player_weapon_stats_2020q1(game_id); -CREATE INDEX player_weapon_stats_2020q1_ix003 on player_weapon_stats_2020q1(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2020q2 ( - CHECK ( create_dt >= DATE '2020-04-01' AND create_dt < DATE '2020-07-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2020q2_ix001 on player_weapon_stats_2020q2(create_dt); -CREATE INDEX player_weapon_stats_2020q2_ix002 on player_weapon_stats_2020q2(game_id); -CREATE INDEX player_weapon_stats_2020q2_ix003 on player_weapon_stats_2020q2(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2020q3 ( - CHECK ( create_dt >= DATE '2020-07-01' AND create_dt < DATE '2020-10-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2020q3_ix001 on player_weapon_stats_2020q3(create_dt); -CREATE INDEX player_weapon_stats_2020q3_ix002 on player_weapon_stats_2020q3(game_id); -CREATE INDEX player_weapon_stats_2020q3_ix003 on player_weapon_stats_2020q3(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2020q4 ( - CHECK ( create_dt >= DATE '2020-10-01' AND create_dt < DATE '2021-01-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2020q4_ix001 on player_weapon_stats_2020q4(create_dt); -CREATE INDEX player_weapon_stats_2020q4_ix002 on player_weapon_stats_2020q4(game_id); -CREATE INDEX player_weapon_stats_2020q4_ix003 on player_weapon_stats_2020q4(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2021q1 ( - CHECK ( create_dt >= DATE '2021-01-01' AND create_dt < DATE '2021-04-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2021q1_ix001 on player_weapon_stats_2021q1(create_dt); -CREATE INDEX player_weapon_stats_2021q1_ix002 on player_weapon_stats_2021q1(game_id); -CREATE INDEX player_weapon_stats_2021q1_ix003 on player_weapon_stats_2021q1(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2021q2 ( - CHECK ( create_dt >= DATE '2021-04-01' AND create_dt < DATE '2021-07-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2021q2_ix001 on player_weapon_stats_2021q2(create_dt); -CREATE INDEX player_weapon_stats_2021q2_ix002 on player_weapon_stats_2021q2(game_id); -CREATE INDEX player_weapon_stats_2021q2_ix003 on player_weapon_stats_2021q2(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2021q3 ( - CHECK ( create_dt >= DATE '2021-07-01' AND create_dt < DATE '2021-10-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2021q3_ix001 on player_weapon_stats_2021q3(create_dt); -CREATE INDEX player_weapon_stats_2021q3_ix002 on player_weapon_stats_2021q3(game_id); -CREATE INDEX player_weapon_stats_2021q3_ix003 on player_weapon_stats_2021q3(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2021q4 ( - CHECK ( create_dt >= DATE '2021-10-01' AND create_dt < DATE '2022-01-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2021q4_ix001 on player_weapon_stats_2021q4(create_dt); -CREATE INDEX player_weapon_stats_2021q4_ix002 on player_weapon_stats_2021q4(game_id); -CREATE INDEX player_weapon_stats_2021q4_ix003 on player_weapon_stats_2021q4(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2022q1 ( - CHECK ( create_dt >= DATE '2022-01-01' AND create_dt < DATE '2022-04-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2022q1_ix001 on player_weapon_stats_2022q1(create_dt); -CREATE INDEX player_weapon_stats_2022q1_ix002 on player_weapon_stats_2022q1(game_id); -CREATE INDEX player_weapon_stats_2022q1_ix003 on player_weapon_stats_2022q1(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2022q2 ( - CHECK ( create_dt >= DATE '2022-04-01' AND create_dt < DATE '2022-07-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2022q2_ix001 on player_weapon_stats_2022q2(create_dt); -CREATE INDEX player_weapon_stats_2022q2_ix002 on player_weapon_stats_2022q2(game_id); -CREATE INDEX player_weapon_stats_2022q2_ix003 on player_weapon_stats_2022q2(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2022q3 ( - CHECK ( create_dt >= DATE '2022-07-01' AND create_dt < DATE '2022-10-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2022q3_ix001 on player_weapon_stats_2022q3(create_dt); -CREATE INDEX player_weapon_stats_2022q3_ix002 on player_weapon_stats_2022q3(game_id); -CREATE INDEX player_weapon_stats_2022q3_ix003 on player_weapon_stats_2022q3(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2022q4 ( - CHECK ( create_dt >= DATE '2022-10-01' AND create_dt < DATE '2023-01-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2022q4_ix001 on player_weapon_stats_2022q4(create_dt); -CREATE INDEX player_weapon_stats_2022q4_ix002 on player_weapon_stats_2022q4(game_id); -CREATE INDEX player_weapon_stats_2022q4_ix003 on player_weapon_stats_2022q4(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2023q1 ( - CHECK ( create_dt >= DATE '2023-01-01' AND create_dt < DATE '2023-04-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2023q1_ix001 on player_weapon_stats_2023q1(create_dt); -CREATE INDEX player_weapon_stats_2023q1_ix002 on player_weapon_stats_2023q1(game_id); -CREATE INDEX player_weapon_stats_2023q1_ix003 on player_weapon_stats_2023q1(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2023q2 ( - CHECK ( create_dt >= DATE '2023-04-01' AND create_dt < DATE '2023-07-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2023q2_ix001 on player_weapon_stats_2023q2(create_dt); -CREATE INDEX player_weapon_stats_2023q2_ix002 on player_weapon_stats_2023q2(game_id); -CREATE INDEX player_weapon_stats_2023q2_ix003 on player_weapon_stats_2023q2(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2023q3 ( - CHECK ( create_dt >= DATE '2023-07-01' AND create_dt < DATE '2023-10-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2023q3_ix001 on player_weapon_stats_2023q3(create_dt); -CREATE INDEX player_weapon_stats_2023q3_ix002 on player_weapon_stats_2023q3(game_id); -CREATE INDEX player_weapon_stats_2023q3_ix003 on player_weapon_stats_2023q3(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2023q4 ( - CHECK ( create_dt >= DATE '2023-10-01' AND create_dt < DATE '2024-01-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2023q4_ix001 on player_weapon_stats_2023q4(create_dt); -CREATE INDEX player_weapon_stats_2023q4_ix002 on player_weapon_stats_2023q4(game_id); -CREATE INDEX player_weapon_stats_2023q4_ix003 on player_weapon_stats_2023q4(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2024q1 ( - CHECK ( create_dt >= DATE '2024-01-01' AND create_dt < DATE '2024-04-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2024q1_ix001 on player_weapon_stats_2024q1(create_dt); -CREATE INDEX player_weapon_stats_2024q1_ix002 on player_weapon_stats_2024q1(game_id); -CREATE INDEX player_weapon_stats_2024q1_ix003 on player_weapon_stats_2024q1(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2024q2 ( - CHECK ( create_dt >= DATE '2024-04-01' AND create_dt < DATE '2024-07-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2024q2_ix001 on player_weapon_stats_2024q2(create_dt); -CREATE INDEX player_weapon_stats_2024q2_ix002 on player_weapon_stats_2024q2(game_id); -CREATE INDEX player_weapon_stats_2024q2_ix003 on player_weapon_stats_2024q2(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2024q3 ( - CHECK ( create_dt >= DATE '2024-07-01' AND create_dt < DATE '2024-10-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2024q3_ix001 on player_weapon_stats_2024q3(create_dt); -CREATE INDEX player_weapon_stats_2024q3_ix002 on player_weapon_stats_2024q3(game_id); -CREATE INDEX player_weapon_stats_2024q3_ix003 on player_weapon_stats_2024q3(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2024q4 ( - CHECK ( create_dt >= DATE '2024-10-01' AND create_dt < DATE '2025-01-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2024q4_ix001 on player_weapon_stats_2024q4(create_dt); -CREATE INDEX player_weapon_stats_2024q4_ix002 on player_weapon_stats_2024q4(game_id); -CREATE INDEX player_weapon_stats_2024q4_ix003 on player_weapon_stats_2024q4(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2025q1 ( - CHECK ( create_dt >= DATE '2025-01-01' AND create_dt < DATE '2025-04-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2025q1_ix001 on player_weapon_stats_2025q1(create_dt); -CREATE INDEX player_weapon_stats_2025q1_ix002 on player_weapon_stats_2025q1(game_id); -CREATE INDEX player_weapon_stats_2025q1_ix003 on player_weapon_stats_2025q1(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2025q2 ( - CHECK ( create_dt >= DATE '2025-04-01' AND create_dt < DATE '2025-07-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2025q2_ix001 on player_weapon_stats_2025q2(create_dt); -CREATE INDEX player_weapon_stats_2025q2_ix002 on player_weapon_stats_2025q2(game_id); -CREATE INDEX player_weapon_stats_2025q2_ix003 on player_weapon_stats_2025q2(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2025q3 ( - CHECK ( create_dt >= DATE '2025-07-01' AND create_dt < DATE '2025-10-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2025q3_ix001 on player_weapon_stats_2025q3(create_dt); -CREATE INDEX player_weapon_stats_2025q3_ix002 on player_weapon_stats_2025q3(game_id); -CREATE INDEX player_weapon_stats_2025q3_ix003 on player_weapon_stats_2025q3(player_id); - -CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2025q4 ( - CHECK ( create_dt >= DATE '2025-10-01' AND create_dt < DATE '2026-01-01' ) -) INHERITS (player_weapon_stats); - -CREATE INDEX player_weapon_stats_2025q4_ix001 on player_weapon_stats_2025q4(create_dt); -CREATE INDEX player_weapon_stats_2025q4_ix002 on player_weapon_stats_2025q4(game_id); -CREATE INDEX player_weapon_stats_2025q4_ix003 on player_weapon_stats_2025q4(player_id); - - diff --git a/tables/players.tab b/tables/players.tab deleted file mode 100755 index 57e81d5..0000000 --- a/tables/players.tab +++ /dev/null @@ -1,15 +0,0 @@ -CREATE TABLE xonstat.players -( - player_id serial NOT NULL, - nick character varying(128), - stripped_nick character varying(128), - "location" character varying(100), - email_addr character varying(255), - active_ind boolean NOT NULL default true, - create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'), - CONSTRAINT players_pk PRIMARY KEY (player_id) -) -WITH ( - OIDS=FALSE -); -ALTER TABLE xonstat.players OWNER TO xonstat; diff --git a/tables/servers.tab b/tables/servers.tab deleted file mode 100755 index cf37cd7..0000000 --- a/tables/servers.tab +++ /dev/null @@ -1,22 +0,0 @@ -CREATE TABLE xonstat.servers -( - server_id serial NOT NULL, - "name" character varying(64), - "location" character varying(100), - ip_addr character varying(50), - port integer, - hashkey character varying(44), - public_key character varying(725), - revision character varying(50), - pure_ind boolean NOT NULL DEFAULT true, - impure_cvars integer NULL, - elo_ind boolean NOT NULL DEFAULT true, - categories character varying(10)[], - active_ind boolean NOT NULL DEFAULT true, - create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'), - CONSTRAINT servers_pk PRIMARY KEY (server_id) -) -WITH ( - OIDS=FALSE -); -ALTER TABLE xonstat.servers OWNER TO xonstat; diff --git a/tables/summary_stats.tab b/tables/summary_stats.tab deleted file mode 100755 index 46c25a5..0000000 --- a/tables/summary_stats.tab +++ /dev/null @@ -1,17 +0,0 @@ -CREATE TABLE xonstat.summary_stats -( - summary_stats_id bigserial NOT NULL, - total_players bigint NOT NULL, - total_servers bigint NOT NULL, - total_games bigint NOT NULL, - total_dm_games bigint NOT NULL, - total_duel_games bigint NOT NULL, - total_ctf_games bigint NOT NULL, - create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'), - CONSTRAINT summary_stats_pk PRIMARY KEY (summary_stats_id) -) -WITH ( - OIDS=FALSE -); - -ALTER TABLE xonstat.summary_stats OWNER TO xonstat; diff --git a/tables/summary_stats_mv.tab b/tables/summary_stats_mv.tab deleted file mode 100755 index 4b8a1f5..0000000 --- a/tables/summary_stats_mv.tab +++ /dev/null @@ -1,10 +0,0 @@ -CREATE TABLE summary_stats_mv ( - scope character varying(30), - sort_order integer, - num_players integer, - game_type_cd character varying(10), - num_games integer, - create_dt timestamp without time zone default (now() at time zone 'UTC') -); - -ALTER TABLE xonstat.summary_stats_mv OWNER TO xonstat; diff --git a/tables/team_game_stats.tab b/tables/team_game_stats.tab deleted file mode 100755 index f7d063a..0000000 --- a/tables/team_game_stats.tab +++ /dev/null @@ -1,358 +0,0 @@ -CREATE TABLE xonstat.team_game_stats -( - team_game_stat_id bigserial NOT NULL, - game_id bigint NOT NULL, - team integer NOT NULL, - score integer, - rounds integer, - caps integer, - create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'), - CONSTRAINT team_game_stats_pk PRIMARY KEY (team_game_stat_id), - CONSTRAINT team_game_stats_uk001 UNIQUE (game_id, team), - CONSTRAINT team_game_stats_fk001 FOREIGN KEY (game_id) - REFERENCES xonstat.games (game_id) MATCH SIMPLE - ON UPDATE NO ACTION ON DELETE CASCADE -) -WITH ( - OIDS=FALSE -); - -CREATE INDEX team_game_stats_ix01 on team_game_stats(game_id); -ALTER TABLE xonstat.team_game_stats OWNER TO xonstat; - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2014q1 ( - CHECK ( create_dt >= DATE '2014-01-01' AND create_dt < DATE '2014-04-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2014q1_ix001 on team_game_stats_2014q1(create_dt); -CREATE INDEX team_game_stats_2014q1_ix002 on team_game_stats_2014q1(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2014q2 ( - CHECK ( create_dt >= DATE '2014-04-01' AND create_dt < DATE '2014-07-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2014q2_ix001 on team_game_stats_2014q2(create_dt); -CREATE INDEX team_game_stats_2014q2_ix002 on team_game_stats_2014q2(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2014q3 ( - CHECK ( create_dt >= DATE '2014-07-01' AND create_dt < DATE '2014-10-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2014q3_ix001 on team_game_stats_2014q3(create_dt); -CREATE INDEX team_game_stats_2014q3_ix002 on team_game_stats_2014q3(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2014q4 ( - CHECK ( create_dt >= DATE '2014-10-01' AND create_dt < DATE '2015-01-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2014q4_ix001 on team_game_stats_2014q4(create_dt); -CREATE INDEX team_game_stats_2014q4_ix002 on team_game_stats_2014q4(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2015q1 ( - CHECK ( create_dt >= DATE '2015-01-01' AND create_dt < DATE '2015-04-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2015q1_ix001 on team_game_stats_2015q1(create_dt); -CREATE INDEX team_game_stats_2015q1_ix002 on team_game_stats_2015q1(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2015q2 ( - CHECK ( create_dt >= DATE '2015-04-01' AND create_dt < DATE '2015-07-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2015q2_ix001 on team_game_stats_2015q2(create_dt); -CREATE INDEX team_game_stats_2015q2_ix002 on team_game_stats_2015q2(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2015q3 ( - CHECK ( create_dt >= DATE '2015-07-01' AND create_dt < DATE '2015-10-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2015q3_ix001 on team_game_stats_2015q3(create_dt); -CREATE INDEX team_game_stats_2015q3_ix002 on team_game_stats_2015q3(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2015q4 ( - CHECK ( create_dt >= DATE '2015-10-01' AND create_dt < DATE '2016-01-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2015q4_ix001 on team_game_stats_2015q4(create_dt); -CREATE INDEX team_game_stats_2015q4_ix002 on team_game_stats_2015q4(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2016q1 ( - CHECK ( create_dt >= DATE '2016-01-01' AND create_dt < DATE '2016-04-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2016q1_ix001 on team_game_stats_2016q1(create_dt); -CREATE INDEX team_game_stats_2016q1_ix002 on team_game_stats_2016q1(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2016q2 ( - CHECK ( create_dt >= DATE '2016-04-01' AND create_dt < DATE '2016-07-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2016q2_ix001 on team_game_stats_2016q2(create_dt); -CREATE INDEX team_game_stats_2016q2_ix002 on team_game_stats_2016q2(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2016q3 ( - CHECK ( create_dt >= DATE '2016-07-01' AND create_dt < DATE '2016-10-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2016q3_ix001 on team_game_stats_2016q3(create_dt); -CREATE INDEX team_game_stats_2016q3_ix002 on team_game_stats_2016q3(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2016q4 ( - CHECK ( create_dt >= DATE '2016-10-01' AND create_dt < DATE '2017-01-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2016q4_ix001 on team_game_stats_2016q4(create_dt); -CREATE INDEX team_game_stats_2016q4_ix002 on team_game_stats_2016q4(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2017q1 ( - CHECK ( create_dt >= DATE '2017-01-01' AND create_dt < DATE '2017-04-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2017q1_ix001 on team_game_stats_2017q1(create_dt); -CREATE INDEX team_game_stats_2017q1_ix002 on team_game_stats_2017q1(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2017q2 ( - CHECK ( create_dt >= DATE '2017-04-01' AND create_dt < DATE '2017-07-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2017q2_ix001 on team_game_stats_2017q2(create_dt); -CREATE INDEX team_game_stats_2017q2_ix002 on team_game_stats_2017q2(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2017q3 ( - CHECK ( create_dt >= DATE '2017-07-01' AND create_dt < DATE '2017-10-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2017q3_ix001 on team_game_stats_2017q3(create_dt); -CREATE INDEX team_game_stats_2017q3_ix002 on team_game_stats_2017q3(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2017q4 ( - CHECK ( create_dt >= DATE '2017-10-01' AND create_dt < DATE '2018-01-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2017q4_ix001 on team_game_stats_2017q4(create_dt); -CREATE INDEX team_game_stats_2017q4_ix002 on team_game_stats_2017q4(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2018q1 ( - CHECK ( create_dt >= DATE '2018-01-01' AND create_dt < DATE '2018-04-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2018q1_ix001 on team_game_stats_2018q1(create_dt); -CREATE INDEX team_game_stats_2018q1_ix002 on team_game_stats_2018q1(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2018q2 ( - CHECK ( create_dt >= DATE '2018-04-01' AND create_dt < DATE '2018-07-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2018q2_ix001 on team_game_stats_2018q2(create_dt); -CREATE INDEX team_game_stats_2018q2_ix002 on team_game_stats_2018q2(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2018q3 ( - CHECK ( create_dt >= DATE '2018-07-01' AND create_dt < DATE '2018-10-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2018q3_ix001 on team_game_stats_2018q3(create_dt); -CREATE INDEX team_game_stats_2018q3_ix002 on team_game_stats_2018q3(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2018q4 ( - CHECK ( create_dt >= DATE '2018-10-01' AND create_dt < DATE '2019-01-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2018q4_ix001 on team_game_stats_2018q4(create_dt); -CREATE INDEX team_game_stats_2018q4_ix002 on team_game_stats_2018q4(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2019q1 ( - CHECK ( create_dt >= DATE '2019-01-01' AND create_dt < DATE '2019-04-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2019q1_ix001 on team_game_stats_2019q1(create_dt); -CREATE INDEX team_game_stats_2019q1_ix002 on team_game_stats_2019q1(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2019q2 ( - CHECK ( create_dt >= DATE '2019-04-01' AND create_dt < DATE '2019-07-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2019q2_ix001 on team_game_stats_2019q2(create_dt); -CREATE INDEX team_game_stats_2019q2_ix002 on team_game_stats_2019q2(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2019q3 ( - CHECK ( create_dt >= DATE '2019-07-01' AND create_dt < DATE '2019-10-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2019q3_ix001 on team_game_stats_2019q3(create_dt); -CREATE INDEX team_game_stats_2019q3_ix002 on team_game_stats_2019q3(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2019q4 ( - CHECK ( create_dt >= DATE '2019-10-01' AND create_dt < DATE '2020-01-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2019q4_ix001 on team_game_stats_2019q4(create_dt); -CREATE INDEX team_game_stats_2019q4_ix002 on team_game_stats_2019q4(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2020q1 ( - CHECK ( create_dt >= DATE '2020-01-01' AND create_dt < DATE '2020-04-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2020q1_ix001 on team_game_stats_2020q1(create_dt); -CREATE INDEX team_game_stats_2020q1_ix002 on team_game_stats_2020q1(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2020q2 ( - CHECK ( create_dt >= DATE '2020-04-01' AND create_dt < DATE '2020-07-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2020q2_ix001 on team_game_stats_2020q2(create_dt); -CREATE INDEX team_game_stats_2020q2_ix002 on team_game_stats_2020q2(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2020q3 ( - CHECK ( create_dt >= DATE '2020-07-01' AND create_dt < DATE '2020-10-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2020q3_ix001 on team_game_stats_2020q3(create_dt); -CREATE INDEX team_game_stats_2020q3_ix002 on team_game_stats_2020q3(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2020q4 ( - CHECK ( create_dt >= DATE '2020-10-01' AND create_dt < DATE '2021-01-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2020q4_ix001 on team_game_stats_2020q4(create_dt); -CREATE INDEX team_game_stats_2020q4_ix002 on team_game_stats_2020q4(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2021q1 ( - CHECK ( create_dt >= DATE '2021-01-01' AND create_dt < DATE '2021-04-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2021q1_ix001 on team_game_stats_2021q1(create_dt); -CREATE INDEX team_game_stats_2021q1_ix002 on team_game_stats_2021q1(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2021q2 ( - CHECK ( create_dt >= DATE '2021-04-01' AND create_dt < DATE '2021-07-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2021q2_ix001 on team_game_stats_2021q2(create_dt); -CREATE INDEX team_game_stats_2021q2_ix002 on team_game_stats_2021q2(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2021q3 ( - CHECK ( create_dt >= DATE '2021-07-01' AND create_dt < DATE '2021-10-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2021q3_ix001 on team_game_stats_2021q3(create_dt); -CREATE INDEX team_game_stats_2021q3_ix002 on team_game_stats_2021q3(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2021q4 ( - CHECK ( create_dt >= DATE '2021-10-01' AND create_dt < DATE '2022-01-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2021q4_ix001 on team_game_stats_2021q4(create_dt); -CREATE INDEX team_game_stats_2021q4_ix002 on team_game_stats_2021q4(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2022q1 ( - CHECK ( create_dt >= DATE '2022-01-01' AND create_dt < DATE '2022-04-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2022q1_ix001 on team_game_stats_2022q1(create_dt); -CREATE INDEX team_game_stats_2022q1_ix002 on team_game_stats_2022q1(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2022q2 ( - CHECK ( create_dt >= DATE '2022-04-01' AND create_dt < DATE '2022-07-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2022q2_ix001 on team_game_stats_2022q2(create_dt); -CREATE INDEX team_game_stats_2022q2_ix002 on team_game_stats_2022q2(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2022q3 ( - CHECK ( create_dt >= DATE '2022-07-01' AND create_dt < DATE '2022-10-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2022q3_ix001 on team_game_stats_2022q3(create_dt); -CREATE INDEX team_game_stats_2022q3_ix002 on team_game_stats_2022q3(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2022q4 ( - CHECK ( create_dt >= DATE '2022-10-01' AND create_dt < DATE '2023-01-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2022q4_ix001 on team_game_stats_2022q4(create_dt); -CREATE INDEX team_game_stats_2022q4_ix002 on team_game_stats_2022q4(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2023q1 ( - CHECK ( create_dt >= DATE '2023-01-01' AND create_dt < DATE '2023-04-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2023q1_ix001 on team_game_stats_2023q1(create_dt); -CREATE INDEX team_game_stats_2023q1_ix002 on team_game_stats_2023q1(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2023q2 ( - CHECK ( create_dt >= DATE '2023-04-01' AND create_dt < DATE '2023-07-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2023q2_ix001 on team_game_stats_2023q2(create_dt); -CREATE INDEX team_game_stats_2023q2_ix002 on team_game_stats_2023q2(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2023q3 ( - CHECK ( create_dt >= DATE '2023-07-01' AND create_dt < DATE '2023-10-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2023q3_ix001 on team_game_stats_2023q3(create_dt); -CREATE INDEX team_game_stats_2023q3_ix002 on team_game_stats_2023q3(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2023q4 ( - CHECK ( create_dt >= DATE '2023-10-01' AND create_dt < DATE '2024-01-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2023q4_ix001 on team_game_stats_2023q4(create_dt); -CREATE INDEX team_game_stats_2023q4_ix002 on team_game_stats_2023q4(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2024q1 ( - CHECK ( create_dt >= DATE '2024-01-01' AND create_dt < DATE '2024-04-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2024q1_ix001 on team_game_stats_2024q1(create_dt); -CREATE INDEX team_game_stats_2024q1_ix002 on team_game_stats_2024q1(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2024q2 ( - CHECK ( create_dt >= DATE '2024-04-01' AND create_dt < DATE '2024-07-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2024q2_ix001 on team_game_stats_2024q2(create_dt); -CREATE INDEX team_game_stats_2024q2_ix002 on team_game_stats_2024q2(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2024q3 ( - CHECK ( create_dt >= DATE '2024-07-01' AND create_dt < DATE '2024-10-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2024q3_ix001 on team_game_stats_2024q3(create_dt); -CREATE INDEX team_game_stats_2024q3_ix002 on team_game_stats_2024q3(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2024q4 ( - CHECK ( create_dt >= DATE '2024-10-01' AND create_dt < DATE '2025-01-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2024q4_ix001 on team_game_stats_2024q4(create_dt); -CREATE INDEX team_game_stats_2024q4_ix002 on team_game_stats_2024q4(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2025q1 ( - CHECK ( create_dt >= DATE '2025-01-01' AND create_dt < DATE '2025-04-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2025q1_ix001 on team_game_stats_2025q1(create_dt); -CREATE INDEX team_game_stats_2025q1_ix002 on team_game_stats_2025q1(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2025q2 ( - CHECK ( create_dt >= DATE '2025-04-01' AND create_dt < DATE '2025-07-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2025q2_ix001 on team_game_stats_2025q2(create_dt); -CREATE INDEX team_game_stats_2025q2_ix002 on team_game_stats_2025q2(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2025q3 ( - CHECK ( create_dt >= DATE '2025-07-01' AND create_dt < DATE '2025-10-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2025q3_ix001 on team_game_stats_2025q3(create_dt); -CREATE INDEX team_game_stats_2025q3_ix002 on team_game_stats_2025q3(game_id); - -CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2025q4 ( - CHECK ( create_dt >= DATE '2025-10-01' AND create_dt < DATE '2026-01-01' ) -) INHERITS (team_game_stats); - -CREATE INDEX team_game_stats_2025q4_ix001 on team_game_stats_2025q4(create_dt); -CREATE INDEX team_game_stats_2025q4_ix002 on team_game_stats_2025q4(game_id); - diff --git a/triggers/games_ins_trg.sql b/triggers/games_ins_trg.sql deleted file mode 100644 index 01b286e..0000000 --- a/triggers/games_ins_trg.sql +++ /dev/null @@ -1,64 +0,0 @@ -CREATE OR REPLACE FUNCTION games_ins() -RETURNS TRIGGER AS $$ -BEGIN - IF (NEW.create_dt >= DATE '2020-01-01' AND NEW.create_dt < DATE '2020-04-01') THEN - INSERT INTO games_2020Q1 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2020-04-01' AND NEW.create_dt < DATE '2020-07-01') THEN - INSERT INTO games_2020Q2 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2020-07-01' AND NEW.create_dt < DATE '2020-10-01') THEN - INSERT INTO games_2020Q3 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2020-10-01' AND NEW.create_dt < DATE '2021-01-01') THEN - INSERT INTO games_2020Q4 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2021-01-01' AND NEW.create_dt < DATE '2021-04-01') THEN - INSERT INTO games_2021Q1 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2021-04-01' AND NEW.create_dt < DATE '2021-07-01') THEN - INSERT INTO games_2021Q2 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2021-07-01' AND NEW.create_dt < DATE '2021-10-01') THEN - INSERT INTO games_2021Q3 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2021-10-01' AND NEW.create_dt < DATE '2022-01-01') THEN - INSERT INTO games_2021Q4 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2022-01-01' AND NEW.create_dt < DATE '2022-04-01') THEN - INSERT INTO games_2022Q1 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2022-04-01' AND NEW.create_dt < DATE '2022-07-01') THEN - INSERT INTO games_2022Q2 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2022-07-01' AND NEW.create_dt < DATE '2022-10-01') THEN - INSERT INTO games_2022Q3 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2022-10-01' AND NEW.create_dt < DATE '2023-01-01') THEN - INSERT INTO games_2022Q4 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2023-01-01' AND NEW.create_dt < DATE '2023-04-01') THEN - INSERT INTO games_2023Q1 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2023-04-01' AND NEW.create_dt < DATE '2023-07-01') THEN - INSERT INTO games_2023Q2 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2023-07-01' AND NEW.create_dt < DATE '2023-10-01') THEN - INSERT INTO games_2023Q3 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2023-10-01' AND NEW.create_dt < DATE '2024-01-01') THEN - INSERT INTO games_2023Q4 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2024-01-01' AND NEW.create_dt < DATE '2024-04-01') THEN - INSERT INTO games_2024Q1 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2024-04-01' AND NEW.create_dt < DATE '2024-07-01') THEN - INSERT INTO games_2024Q2 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2024-07-01' AND NEW.create_dt < DATE '2024-10-01') THEN - INSERT INTO games_2024Q3 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2024-10-01' AND NEW.create_dt < DATE '2025-01-01') THEN - INSERT INTO games_2024Q4 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2025-01-01' AND NEW.create_dt < DATE '2025-04-01') THEN - INSERT INTO games_2025Q1 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2025-04-01' AND NEW.create_dt < DATE '2025-07-01') THEN - INSERT INTO games_2025Q2 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2025-07-01' AND NEW.create_dt < DATE '2025-10-01') THEN - INSERT INTO games_2025Q3 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2025-10-01' AND NEW.create_dt < DATE '2026-01-01') THEN - INSERT INTO games_2025Q4 VALUES (NEW.*); - ELSE - RAISE EXCEPTION 'Date out of range. Fix the games_ins() trigger!'; - END IF; - RETURN NULL; -END -$$ -LANGUAGE plpgsql; - - -DROP TRIGGER IF EXISTS games_ins_trg ON xonstat.games; -CREATE TRIGGER games_ins_trg - BEFORE INSERT on xonstat.games - FOR EACH ROW EXECUTE PROCEDURE games_ins(); diff --git a/triggers/player_game_frag_matrix_ins_trg.sql b/triggers/player_game_frag_matrix_ins_trg.sql deleted file mode 100644 index 8290f15..0000000 --- a/triggers/player_game_frag_matrix_ins_trg.sql +++ /dev/null @@ -1,63 +0,0 @@ -CREATE OR REPLACE FUNCTION player_game_frag_matrix_ins() -RETURNS TRIGGER AS $$ -BEGIN - IF (NEW.create_dt >= DATE '2020-01-01' AND NEW.create_dt < DATE '2020-04-01') THEN - INSERT INTO player_game_frag_matrix_2020Q1 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2020-04-01' AND NEW.create_dt < DATE '2020-07-01') THEN - INSERT INTO player_game_frag_matrix_2020Q2 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2020-07-01' AND NEW.create_dt < DATE '2020-10-01') THEN - INSERT INTO player_game_frag_matrix_2020Q3 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2020-10-01' AND NEW.create_dt < DATE '2021-01-01') THEN - INSERT INTO player_game_frag_matrix_2020Q4 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2021-01-01' AND NEW.create_dt < DATE '2021-04-01') THEN - INSERT INTO player_game_frag_matrix_2021Q1 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2021-04-01' AND NEW.create_dt < DATE '2021-07-01') THEN - INSERT INTO player_game_frag_matrix_2021Q2 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2021-07-01' AND NEW.create_dt < DATE '2021-10-01') THEN - INSERT INTO player_game_frag_matrix_2021Q3 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2021-10-01' AND NEW.create_dt < DATE '2022-01-01') THEN - INSERT INTO player_game_frag_matrix_2021Q4 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2022-01-01' AND NEW.create_dt < DATE '2022-04-01') THEN - INSERT INTO player_game_frag_matrix_2022Q1 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2022-04-01' AND NEW.create_dt < DATE '2022-07-01') THEN - INSERT INTO player_game_frag_matrix_2022Q2 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2022-07-01' AND NEW.create_dt < DATE '2022-10-01') THEN - INSERT INTO player_game_frag_matrix_2022Q3 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2022-10-01' AND NEW.create_dt < DATE '2023-01-01') THEN - INSERT INTO player_game_frag_matrix_2022Q4 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2023-01-01' AND NEW.create_dt < DATE '2023-04-01') THEN - INSERT INTO player_game_frag_matrix_2023Q1 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2023-04-01' AND NEW.create_dt < DATE '2023-07-01') THEN - INSERT INTO player_game_frag_matrix_2023Q2 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2023-07-01' AND NEW.create_dt < DATE '2023-10-01') THEN - INSERT INTO player_game_frag_matrix_2023Q3 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2023-10-01' AND NEW.create_dt < DATE '2024-01-01') THEN - INSERT INTO player_game_frag_matrix_2023Q4 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2024-01-01' AND NEW.create_dt < DATE '2024-04-01') THEN - INSERT INTO player_game_frag_matrix_2024Q1 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2024-04-01' AND NEW.create_dt < DATE '2024-07-01') THEN - INSERT INTO player_game_frag_matrix_2024Q2 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2024-07-01' AND NEW.create_dt < DATE '2024-10-01') THEN - INSERT INTO player_game_frag_matrix_2024Q3 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2024-10-01' AND NEW.create_dt < DATE '2025-01-01') THEN - INSERT INTO player_game_frag_matrix_2024Q4 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2025-01-01' AND NEW.create_dt < DATE '2025-04-01') THEN - INSERT INTO player_game_frag_matrix_2025Q1 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2025-04-01' AND NEW.create_dt < DATE '2025-07-01') THEN - INSERT INTO player_game_frag_matrix_2025Q2 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2025-07-01' AND NEW.create_dt < DATE '2025-10-01') THEN - INSERT INTO player_game_frag_matrix_2025Q3 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2025-10-01' AND NEW.create_dt < DATE '2026-01-01') THEN - INSERT INTO player_game_frag_matrix_2025Q4 VALUES (NEW.*); - ELSE - RAISE EXCEPTION 'Date out of range. Fix the player_game_frag_matrix_ins() trigger!'; - END IF; - RETURN NULL; -END -$$ -LANGUAGE plpgsql; - -DROP TRIGGER IF EXISTS player_game_frag_matrix_ins_trg ON xonstat.player_game_frag_matrix; -CREATE TRIGGER player_game_frag_matrix_ins_trg - BEFORE INSERT on xonstat.player_game_frag_matrix - FOR EACH ROW EXECUTE PROCEDURE player_game_frag_matrix_ins(); diff --git a/triggers/player_game_nonparticipants_ins_trg.sql b/triggers/player_game_nonparticipants_ins_trg.sql deleted file mode 100644 index be24a43..0000000 --- a/triggers/player_game_nonparticipants_ins_trg.sql +++ /dev/null @@ -1,63 +0,0 @@ -CREATE OR REPLACE FUNCTION player_game_nonparticipants_ins() -RETURNS TRIGGER AS $$ -BEGIN - IF (NEW.create_dt >= DATE '2020-01-01' AND NEW.create_dt < DATE '2020-04-01') THEN - INSERT INTO player_game_nonparticipants_2020Q1 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2020-04-01' AND NEW.create_dt < DATE '2020-07-01') THEN - INSERT INTO player_game_nonparticipants_2020Q2 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2020-07-01' AND NEW.create_dt < DATE '2020-10-01') THEN - INSERT INTO player_game_nonparticipants_2020Q3 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2020-10-01' AND NEW.create_dt < DATE '2021-01-01') THEN - INSERT INTO player_game_nonparticipants_2020Q4 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2021-01-01' AND NEW.create_dt < DATE '2021-04-01') THEN - INSERT INTO player_game_nonparticipants_2021Q1 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2021-04-01' AND NEW.create_dt < DATE '2021-07-01') THEN - INSERT INTO player_game_nonparticipants_2021Q2 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2021-07-01' AND NEW.create_dt < DATE '2021-10-01') THEN - INSERT INTO player_game_nonparticipants_2021Q3 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2021-10-01' AND NEW.create_dt < DATE '2022-01-01') THEN - INSERT INTO player_game_nonparticipants_2021Q4 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2022-01-01' AND NEW.create_dt < DATE '2022-04-01') THEN - INSERT INTO player_game_nonparticipants_2022Q1 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2022-04-01' AND NEW.create_dt < DATE '2022-07-01') THEN - INSERT INTO player_game_nonparticipants_2022Q2 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2022-07-01' AND NEW.create_dt < DATE '2022-10-01') THEN - INSERT INTO player_game_nonparticipants_2022Q3 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2022-10-01' AND NEW.create_dt < DATE '2023-01-01') THEN - INSERT INTO player_game_nonparticipants_2022Q4 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2023-01-01' AND NEW.create_dt < DATE '2023-04-01') THEN - INSERT INTO player_game_nonparticipants_2023Q1 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2023-04-01' AND NEW.create_dt < DATE '2023-07-01') THEN - INSERT INTO player_game_nonparticipants_2023Q2 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2023-07-01' AND NEW.create_dt < DATE '2023-10-01') THEN - INSERT INTO player_game_nonparticipants_2023Q3 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2023-10-01' AND NEW.create_dt < DATE '2024-01-01') THEN - INSERT INTO player_game_nonparticipants_2023Q4 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2024-01-01' AND NEW.create_dt < DATE '2024-04-01') THEN - INSERT INTO player_game_nonparticipants_2024Q1 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2024-04-01' AND NEW.create_dt < DATE '2024-07-01') THEN - INSERT INTO player_game_nonparticipants_2024Q2 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2024-07-01' AND NEW.create_dt < DATE '2024-10-01') THEN - INSERT INTO player_game_nonparticipants_2024Q3 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2024-10-01' AND NEW.create_dt < DATE '2025-01-01') THEN - INSERT INTO player_game_nonparticipants_2024Q4 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2025-01-01' AND NEW.create_dt < DATE '2025-04-01') THEN - INSERT INTO player_game_nonparticipants_2025Q1 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2025-04-01' AND NEW.create_dt < DATE '2025-07-01') THEN - INSERT INTO player_game_nonparticipants_2025Q2 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2025-07-01' AND NEW.create_dt < DATE '2025-10-01') THEN - INSERT INTO player_game_nonparticipants_2025Q3 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2025-10-01' AND NEW.create_dt < DATE '2026-01-01') THEN - INSERT INTO player_game_nonparticipants_2025Q4 VALUES (NEW.*); - ELSE - RAISE EXCEPTION 'Date out of range. Fix the player_game_nonparticipants_ins() trigger!'; - END IF; - RETURN NULL; -END -$$ -LANGUAGE plpgsql; - -DROP TRIGGER IF EXISTS player_game_nonparticipants_ins_trg ON xonstat.player_game_nonparticipants; -CREATE TRIGGER player_game_nonparticipants_ins_trg -BEFORE INSERT on xonstat.player_game_nonparticipants -FOR EACH ROW EXECUTE PROCEDURE player_game_nonparticipants_ins(); diff --git a/triggers/player_game_stats_ins_trg.sql b/triggers/player_game_stats_ins_trg.sql deleted file mode 100644 index 66fcc1c..0000000 --- a/triggers/player_game_stats_ins_trg.sql +++ /dev/null @@ -1,63 +0,0 @@ -CREATE OR REPLACE FUNCTION player_game_stats_ins() -RETURNS TRIGGER AS $$ -BEGIN - IF (NEW.create_dt >= DATE '2020-01-01' AND NEW.create_dt < DATE '2020-04-01') THEN - INSERT INTO player_game_stats_2020Q1 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2020-04-01' AND NEW.create_dt < DATE '2020-07-01') THEN - INSERT INTO player_game_stats_2020Q2 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2020-07-01' AND NEW.create_dt < DATE '2020-10-01') THEN - INSERT INTO player_game_stats_2020Q3 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2020-10-01' AND NEW.create_dt < DATE '2021-01-01') THEN - INSERT INTO player_game_stats_2020Q4 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2021-01-01' AND NEW.create_dt < DATE '2021-04-01') THEN - INSERT INTO player_game_stats_2021Q1 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2021-04-01' AND NEW.create_dt < DATE '2021-07-01') THEN - INSERT INTO player_game_stats_2021Q2 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2021-07-01' AND NEW.create_dt < DATE '2021-10-01') THEN - INSERT INTO player_game_stats_2021Q3 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2021-10-01' AND NEW.create_dt < DATE '2022-01-01') THEN - INSERT INTO player_game_stats_2021Q4 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2022-01-01' AND NEW.create_dt < DATE '2022-04-01') THEN - INSERT INTO player_game_stats_2022Q1 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2022-04-01' AND NEW.create_dt < DATE '2022-07-01') THEN - INSERT INTO player_game_stats_2022Q2 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2022-07-01' AND NEW.create_dt < DATE '2022-10-01') THEN - INSERT INTO player_game_stats_2022Q3 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2022-10-01' AND NEW.create_dt < DATE '2023-01-01') THEN - INSERT INTO player_game_stats_2022Q4 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2023-01-01' AND NEW.create_dt < DATE '2023-04-01') THEN - INSERT INTO player_game_stats_2023Q1 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2023-04-01' AND NEW.create_dt < DATE '2023-07-01') THEN - INSERT INTO player_game_stats_2023Q2 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2023-07-01' AND NEW.create_dt < DATE '2023-10-01') THEN - INSERT INTO player_game_stats_2023Q3 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2023-10-01' AND NEW.create_dt < DATE '2024-01-01') THEN - INSERT INTO player_game_stats_2023Q4 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2024-01-01' AND NEW.create_dt < DATE '2024-04-01') THEN - INSERT INTO player_game_stats_2024Q1 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2024-04-01' AND NEW.create_dt < DATE '2024-07-01') THEN - INSERT INTO player_game_stats_2024Q2 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2024-07-01' AND NEW.create_dt < DATE '2024-10-01') THEN - INSERT INTO player_game_stats_2024Q3 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2024-10-01' AND NEW.create_dt < DATE '2025-01-01') THEN - INSERT INTO player_game_stats_2024Q4 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2025-01-01' AND NEW.create_dt < DATE '2025-04-01') THEN - INSERT INTO player_game_stats_2025Q1 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2025-04-01' AND NEW.create_dt < DATE '2025-07-01') THEN - INSERT INTO player_game_stats_2025Q2 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2025-07-01' AND NEW.create_dt < DATE '2025-10-01') THEN - INSERT INTO player_game_stats_2025Q3 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2025-10-01' AND NEW.create_dt < DATE '2026-01-01') THEN - INSERT INTO player_game_stats_2025Q4 VALUES (NEW.*); - ELSE - RAISE EXCEPTION 'Date out of range. Fix the player_game_stats_ins() trigger!'; - END IF; - RETURN NULL; -END -$$ -LANGUAGE plpgsql; - -DROP TRIGGER IF EXISTS player_game_stats_ins_trg ON xonstat.player_game_stats; -CREATE TRIGGER player_game_stats_ins_trg - BEFORE INSERT on xonstat.player_game_stats - FOR EACH ROW EXECUTE PROCEDURE player_game_stats_ins(); diff --git a/triggers/player_weapon_stats_ins_trg.sql b/triggers/player_weapon_stats_ins_trg.sql deleted file mode 100644 index f109622..0000000 --- a/triggers/player_weapon_stats_ins_trg.sql +++ /dev/null @@ -1,63 +0,0 @@ -CREATE OR REPLACE FUNCTION player_weapon_stats_ins() -RETURNS TRIGGER AS $$ -BEGIN - IF (NEW.create_dt >= DATE '2020-01-01' AND NEW.create_dt < DATE '2020-04-01') THEN - INSERT INTO player_weapon_stats_2020Q1 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2020-04-01' AND NEW.create_dt < DATE '2020-07-01') THEN - INSERT INTO player_weapon_stats_2020Q2 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2020-07-01' AND NEW.create_dt < DATE '2020-10-01') THEN - INSERT INTO player_weapon_stats_2020Q3 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2020-10-01' AND NEW.create_dt < DATE '2021-01-01') THEN - INSERT INTO player_weapon_stats_2020Q4 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2021-01-01' AND NEW.create_dt < DATE '2021-04-01') THEN - INSERT INTO player_weapon_stats_2021Q1 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2021-04-01' AND NEW.create_dt < DATE '2021-07-01') THEN - INSERT INTO player_weapon_stats_2021Q2 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2021-07-01' AND NEW.create_dt < DATE '2021-10-01') THEN - INSERT INTO player_weapon_stats_2021Q3 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2021-10-01' AND NEW.create_dt < DATE '2022-01-01') THEN - INSERT INTO player_weapon_stats_2021Q4 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2022-01-01' AND NEW.create_dt < DATE '2022-04-01') THEN - INSERT INTO player_weapon_stats_2022Q1 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2022-04-01' AND NEW.create_dt < DATE '2022-07-01') THEN - INSERT INTO player_weapon_stats_2022Q2 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2022-07-01' AND NEW.create_dt < DATE '2022-10-01') THEN - INSERT INTO player_weapon_stats_2022Q3 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2022-10-01' AND NEW.create_dt < DATE '2023-01-01') THEN - INSERT INTO player_weapon_stats_2022Q4 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2023-01-01' AND NEW.create_dt < DATE '2023-04-01') THEN - INSERT INTO player_weapon_stats_2023Q1 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2023-04-01' AND NEW.create_dt < DATE '2023-07-01') THEN - INSERT INTO player_weapon_stats_2023Q2 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2023-07-01' AND NEW.create_dt < DATE '2023-10-01') THEN - INSERT INTO player_weapon_stats_2023Q3 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2023-10-01' AND NEW.create_dt < DATE '2024-01-01') THEN - INSERT INTO player_weapon_stats_2023Q4 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2024-01-01' AND NEW.create_dt < DATE '2024-04-01') THEN - INSERT INTO player_weapon_stats_2024Q1 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2024-04-01' AND NEW.create_dt < DATE '2024-07-01') THEN - INSERT INTO player_weapon_stats_2024Q2 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2024-07-01' AND NEW.create_dt < DATE '2024-10-01') THEN - INSERT INTO player_weapon_stats_2024Q3 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2024-10-01' AND NEW.create_dt < DATE '2025-01-01') THEN - INSERT INTO player_weapon_stats_2024Q4 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2025-01-01' AND NEW.create_dt < DATE '2025-04-01') THEN - INSERT INTO player_weapon_stats_2025Q1 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2025-04-01' AND NEW.create_dt < DATE '2025-07-01') THEN - INSERT INTO player_weapon_stats_2025Q2 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2025-07-01' AND NEW.create_dt < DATE '2025-10-01') THEN - INSERT INTO player_weapon_stats_2025Q3 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2025-10-01' AND NEW.create_dt < DATE '2026-01-01') THEN - INSERT INTO player_weapon_stats_2025Q4 VALUES (NEW.*); - ELSE - RAISE EXCEPTION 'Date out of range. Fix the player_weapon_stats_ins() trigger!'; - END IF; - RETURN NULL; -END -$$ -LANGUAGE plpgsql; - -DROP TRIGGER IF EXISTS player_weapon_stats_ins_trg ON xonstat.player_weapon_stats; -CREATE TRIGGER player_weapon_stats_ins_trg - BEFORE INSERT on xonstat.player_weapon_stats - FOR EACH ROW EXECUTE PROCEDURE player_weapon_stats_ins(); diff --git a/triggers/team_game_stats_ins_trg.sql b/triggers/team_game_stats_ins_trg.sql deleted file mode 100644 index 86ef3a4..0000000 --- a/triggers/team_game_stats_ins_trg.sql +++ /dev/null @@ -1,63 +0,0 @@ -CREATE OR REPLACE FUNCTION team_game_stats_ins() -RETURNS TRIGGER AS $$ -BEGIN - IF (NEW.create_dt >= DATE '2020-01-01' AND NEW.create_dt < DATE '2020-04-01') THEN - INSERT INTO team_game_stats_2020Q1 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2020-04-01' AND NEW.create_dt < DATE '2020-07-01') THEN - INSERT INTO team_game_stats_2020Q2 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2020-07-01' AND NEW.create_dt < DATE '2020-10-01') THEN - INSERT INTO team_game_stats_2020Q3 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2020-10-01' AND NEW.create_dt < DATE '2021-01-01') THEN - INSERT INTO team_game_stats_2020Q4 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2021-01-01' AND NEW.create_dt < DATE '2021-04-01') THEN - INSERT INTO team_game_stats_2021Q1 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2021-04-01' AND NEW.create_dt < DATE '2021-07-01') THEN - INSERT INTO team_game_stats_2021Q2 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2021-07-01' AND NEW.create_dt < DATE '2021-10-01') THEN - INSERT INTO team_game_stats_2021Q3 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2021-10-01' AND NEW.create_dt < DATE '2022-01-01') THEN - INSERT INTO team_game_stats_2021Q4 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2022-01-01' AND NEW.create_dt < DATE '2022-04-01') THEN - INSERT INTO team_game_stats_2022Q1 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2022-04-01' AND NEW.create_dt < DATE '2022-07-01') THEN - INSERT INTO team_game_stats_2022Q2 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2022-07-01' AND NEW.create_dt < DATE '2022-10-01') THEN - INSERT INTO team_game_stats_2022Q3 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2022-10-01' AND NEW.create_dt < DATE '2023-01-01') THEN - INSERT INTO team_game_stats_2022Q4 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2023-01-01' AND NEW.create_dt < DATE '2023-04-01') THEN - INSERT INTO team_game_stats_2023Q1 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2023-04-01' AND NEW.create_dt < DATE '2023-07-01') THEN - INSERT INTO team_game_stats_2023Q2 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2023-07-01' AND NEW.create_dt < DATE '2023-10-01') THEN - INSERT INTO team_game_stats_2023Q3 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2023-10-01' AND NEW.create_dt < DATE '2024-01-01') THEN - INSERT INTO team_game_stats_2023Q4 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2024-01-01' AND NEW.create_dt < DATE '2024-04-01') THEN - INSERT INTO team_game_stats_2024Q1 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2024-04-01' AND NEW.create_dt < DATE '2024-07-01') THEN - INSERT INTO team_game_stats_2024Q2 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2024-07-01' AND NEW.create_dt < DATE '2024-10-01') THEN - INSERT INTO team_game_stats_2024Q3 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2024-10-01' AND NEW.create_dt < DATE '2025-01-01') THEN - INSERT INTO team_game_stats_2024Q4 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2025-01-01' AND NEW.create_dt < DATE '2025-04-01') THEN - INSERT INTO team_game_stats_2025Q1 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2025-04-01' AND NEW.create_dt < DATE '2025-07-01') THEN - INSERT INTO team_game_stats_2025Q2 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2025-07-01' AND NEW.create_dt < DATE '2025-10-01') THEN - INSERT INTO team_game_stats_2025Q3 VALUES (NEW.*); - ELSIF (NEW.create_dt >= DATE '2025-10-01' AND NEW.create_dt < DATE '2026-01-01') THEN - INSERT INTO team_game_stats_2025Q4 VALUES (NEW.*); - ELSE - RAISE EXCEPTION 'Date out of range. Fix the team_game_stats_ins() trigger!'; - END IF; - RETURN NULL; -END -$$ -LANGUAGE plpgsql; - -DROP TRIGGER IF EXISTS team_game_stats_ins_trg ON xonstat.team_game_stats; -CREATE TRIGGER team_game_stats_ins_trg - BEFORE INSERT on xonstat.team_game_stats - FOR EACH ROW EXECUTE PROCEDURE team_game_stats_ins(); -- 2.39.2