pixel counters are never null in the database

This commit is contained in:
HF 2022-09-11 18:47:02 +02:00
parent 96c6aaa23e
commit 7236e1c3c6

View File

@ -38,11 +38,11 @@ class Ranks {
// recalculate ranking column
await sequelize.query(
// eslint-disable-next-line max-len
'SET @r=0; UPDATE Users SET ranking= @r:= (@r + 1) WHERE totalPixels IS NOT NULL ORDER BY totalPixels DESC;',
'SET @r=0; UPDATE Users SET ranking= @r:= (@r + 1) ORDER BY totalPixels DESC;',
);
await sequelize.query(
// eslint-disable-next-line max-len
'SET @r=0; UPDATE Users SET dailyRanking= @r:= (@r + 1) WHERE dailyTotalPixels IS NOT NULL ORDER BY dailyTotalPixels DESC;',
'SET @r=0; UPDATE Users SET dailyRanking= @r:= (@r + 1) ORDER BY dailyTotalPixels DESC;',
);
} else {
logger.info('Get pixel rankings from SQL');