From fed2bc2e0d8875fd732d24d7908e5792afa1f8c1 Mon Sep 17 00:00:00 2001 From: Travis Ralston <travpc@gmail.com> Date: Mon, 31 Jul 2023 20:19:48 -0600 Subject: [PATCH] Fix limit query --- database/table_thumbnails.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/table_thumbnails.go b/database/table_thumbnails.go index e4cdd231..9b6bc1f4 100644 --- a/database/table_thumbnails.go +++ b/database/table_thumbnails.go @@ -30,7 +30,7 @@ const insertThumbnail = "INSERT INTO thumbnails (origin, media_id, content_type, const selectThumbnailByLocationExists = "SELECT TRUE FROM thumbnails WHERE datastore_id = $1 AND location = $2 LIMIT 1;" const selectThumbnailsForMedia = "SELECT origin, media_id, content_type, width, height, method, animated, sha256_hash, size_bytes, creation_ts, datastore_id, location FROM thumbnails WHERE origin = $1 AND media_id = $2;" const selectOldThumbnails = "SELECT origin, media_id, content_type, width, height, method, animated, sha256_hash, size_bytes, creation_ts, datastore_id, location FROM thumbnails WHERE sha256_hash IN (SELECT t2.sha256_hash FROM thumbnails AS t2 WHERE t2.creation_ts < $1);" -const deleteThumbnail = "DELETE FROM thumbnails WHERE origin = $1 AND media_id = $2 AND content_type = $3 AND width = $4 AND height = $5 AND method = $6 AND animated = $7 AND sha256_hash = $8 AND size_bytes = $9 AND creation_ts = $10 AND datastore_id = $11 AND location = $11 LIMIT 1;" +const deleteThumbnail = "DELETE FROM thumbnails WHERE origin = $1 AND media_id = $2 AND content_type = $3 AND width = $4 AND height = $5 AND method = $6 AND animated = $7 AND sha256_hash = $8 AND size_bytes = $9 AND creation_ts = $10 AND datastore_id = $11 AND location = $11;" type thumbnailsTableStatements struct { selectThumbnailByParams *sql.Stmt -- GitLab