+++ /dev/null
--- 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;
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(
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;
+++ /dev/null
-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;
+++ /dev/null
-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;
+++ /dev/null
-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;
+++ /dev/null
-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;
+++ /dev/null
-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;
+++ /dev/null
-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;
-
+++ /dev/null
-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;
+++ /dev/null
-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;
+++ /dev/null
-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;
+++ /dev/null
-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;
+++ /dev/null
-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;
+++ /dev/null
-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;
+++ /dev/null
-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;
-
+++ /dev/null
-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;
+++ /dev/null
-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;
+++ /dev/null
-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;
+++ /dev/null
-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;
+++ /dev/null
-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;
+++ /dev/null
-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;
+++ /dev/null
-CREATE TABLE xonstat.player_game_anticheats\r
-(\r
- player_game_anticheat_id bigserial NOT NULL,\r
- player_id integer NOT NULL,\r
- game_id bigint NOT NULL,\r
- key character varying(128),\r
- value numeric,\r
- create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'),\r
- CONSTRAINT player_game_anticheats_pk PRIMARY KEY (player_game_anticheat_id),\r
- CONSTRAINT player_game_anticheats_fk01 FOREIGN KEY (player_id)\r
- REFERENCES players (player_id) MATCH SIMPLE\r
- ON UPDATE NO ACTION ON DELETE NO ACTION\r
-)\r
-WITH (\r
- OIDS=FALSE\r
-);\r
-\r
-CREATE INDEX player_game_anticheats_ix01 on player_game_anticheats(game_id);\r
-CREATE INDEX player_game_anticheats_ix02 on player_game_anticheats(player_id);\r
-ALTER TABLE xonstat.player_game_anticheats OWNER TO xonstat;\r
+++ /dev/null
-CREATE TABLE xonstat.player_game_frag_matrix
-(
- game_id bigint NOT NULL,
- player_game_stat_id bigint NOT NULL,
- player_id integer NOT NULL,
- player_index smallint NOT NULL,
- matrix 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);
-
+++ /dev/null
-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);
-
+++ /dev/null
-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);
-
-
+++ /dev/null
-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;
+++ /dev/null
-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;
+++ /dev/null
-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;
+++ /dev/null
-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;
+++ /dev/null
-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;
+++ /dev/null
-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;
+++ /dev/null
-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;
+++ /dev/null
-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;
+++ /dev/null
-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);
-
-
+++ /dev/null
-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;
+++ /dev/null
-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;
+++ /dev/null
-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;
+++ /dev/null
-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;
+++ /dev/null
-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);
-
+++ /dev/null
-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();
+++ /dev/null
-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();
+++ /dev/null
-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();
+++ /dev/null
-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();
+++ /dev/null
-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();
+++ /dev/null
-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();