From 6644084b01153e52ced3d9fd2d24ed5f3f6c2c60 Mon Sep 17 00:00:00 2001 From: Ant Zucaro Date: Mon, 11 Jun 2012 07:01:05 -0400 Subject: [PATCH] Add an active indicator to player_elo. This will allow me to disable the ranking of players without disabling the entire player record. This is to be applied in cases where players have cheated more than once but don't warrant a full kickban. Instead I can now make their record essentially harmless with respect to everyone else. --- scripts/update_ranks.sql | 5 +++-- tables/player_elos.tab | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/update_ranks.sql b/scripts/update_ranks.sql index 77c7c79..a985543 100644 --- a/scripts/update_ranks.sql +++ b/scripts/update_ranks.sql @@ -12,7 +12,8 @@ begin; over (partition by pe.game_type_cd order by pe.elo desc) from players p, player_elos pe where p.player_id = pe.player_id - and p.active_ind = 'Y' - and pe.games > 32; + and p.active_ind = True + and pe.active_ind = True + and pe.games >= 32; end; diff --git a/tables/player_elos.tab b/tables/player_elos.tab index 0c0e024..da01eb0 100755 --- a/tables/player_elos.tab +++ b/tables/player_elos.tab @@ -4,6 +4,7 @@ CREATE TABLE xonstat.player_elos game_type_cd character varying(10) NOT NULL, 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'), CONSTRAINT player_elos_pk PRIMARY KEY (player_id, game_type_cd), CONSTRAINT player_elos_fk01 FOREIGN KEY (player_id) -- 2.39.2