From 58530e70bbd741d29fbc7b7904c37dcbc3ec1648 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 17 Sep 2023 12:10:11 +0200 Subject: Move mtime and active into games table. Avoid joining with game_state for all the game list views. --- tools/elo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/elo.js') diff --git a/tools/elo.js b/tools/elo.js index 95ca58b..a6f9c9d 100644 --- a/tools/elo.js +++ b/tools/elo.js @@ -4,7 +4,7 @@ const sqlite3 = require("better-sqlite3") const db = new sqlite3("db") -const SQL_SELECT_GAMES = db.prepare("select * from games where status>1 and user_count=player_count and player_count>1 order by xtime") +const SQL_SELECT_GAMES = db.prepare("select * from rated_games_view order by mtime") const SQL_SELECT_RATING = db.prepare("select * from player_rating_view where game_id=?") const SQL_INSERT_RATING = db.prepare("insert or replace into ratings (title_id,user_id,rating,count,last) values (?,?,?,?,?)") -- cgit v1.2.3