]> git.xonotic.org Git - xonotic/xonstatdb.git/blob - scripts/update_elos.sql
38d456d8aa2eabd5ba03500b5612a9b3ccd0cef0
[xonotic/xonstatdb.git] / scripts / update_elos.sql
1 begin;
2   update player_elos
3   set elo=greatest(100, elo - ((current_date - (update_dt::date)-31)/7))
4   where update_dt < (current_timestamp at time zone 'UTC' - interval '30 days')
5   and elo != 100;
6 end;