fix bug with saving best rank (lower rank should be better)

This commit is contained in:
Dawid Wysokiński 2020-07-12 11:52:11 +02:00 committed by Kichiyaki
parent f53d427bf7
commit 5c069c919f
1 changed files with 2 additions and 2 deletions

View File

@ -111,7 +111,7 @@ const (
NEW.most_villages = NEW.total_villages;
NEW.most_villages_at = now();
END IF;
IF NEW.best_rank IS null OR NEW.rank > NEW.best_rank THEN
IF NEW.best_rank IS null OR NEW.rank < NEW.best_rank THEN
NEW.best_rank = NEW.rank;
NEW.best_rank_at = now();
END IF;
@ -133,7 +133,7 @@ const (
NEW.most_villages = NEW.total_villages;
NEW.most_villages_at = now();
END IF;
IF NEW.best_rank IS null OR NEW.rank > OLD.best_rank THEN
IF NEW.best_rank IS null OR NEW.rank < OLD.best_rank THEN
NEW.best_rank = NEW.rank;
NEW.best_rank_at = now();
END IF;