Fix query to work in postgresql

This commit is contained in:
Hugo Peixoto 2023-08-01 19:58:31 +01:00
parent c9ee626258
commit 23574c7790
1 changed files with 1 additions and 1 deletions

View File

@ -39,7 +39,7 @@ get '/' do
SELECT
COUNT(1) AS total,
SUM(size) AS bytes
FROM (select size from downloads group by video_id) as x;
FROM (select MAX(size) AS size from downloads group by video_id) as x;
")[0]
videos = ActiveRecord::Base.connection.execute("select count(1) AS total from videos;")[0]