]> git.xonotic.org Git - xonotic/xonstatdb.git/commitdiff
Add an active indicator to player_elo.
authorAnt Zucaro <azucaro@gmail.com>
Mon, 11 Jun 2012 11:01:05 +0000 (07:01 -0400)
committerAnt Zucaro <azucaro@gmail.com>
Mon, 11 Jun 2012 11:01:05 +0000 (07:01 -0400)
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
tables/player_elos.tab

index 77c7c796ac1f986ed1f4548028533908e7ad060b..a985543a37f368fd034557a5dda2f863c974da76 100644 (file)
@@ -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;
index 0c0e024c3bc6d98738e9a5373e851971081a0618..da01eb01f8908f6b73c9e5f79e3cd6d832118693 100755 (executable)
@@ -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)