Skip to content

Commit

Permalink
FIX: Update 'Largest Uploads' queries to use the upload_references ta…
Browse files Browse the repository at this point in the history
…ble (#261)

The post_uploads table has been deprecated. This commit updates the 'Top 50 Largest Uploads' query to use the new upload_references table instead.
  • Loading branch information
JimmyJammyDodger authored Nov 13, 2023
1 parent fbe2a37 commit 9f841a4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/discourse_data_explorer/queries.rb
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,9 @@ def self.default
uploads.extension,
uploads.created_at,
uploads.url
FROM post_uploads
JOIN uploads ON uploads.id = post_uploads.upload_id
JOIN posts ON posts.id = post_uploads.post_id
FROM upload_references
JOIN uploads ON uploads.id = upload_references.upload_id
JOIN posts ON posts.id = upload_references.target_id AND upload_references.target_type = 'Post'
ORDER BY uploads.filesize DESC
LIMIT 50
SQL
Expand Down

0 comments on commit 9f841a4

Please sign in to comment.