]> cat aescling's git repositories - mastodon.git/commitdiff
Fix Ambiguous SQL error on tootctl media refresh (#19206)
authorJeong Arm <kjwonmail@gmail.com>
Tue, 20 Sep 2022 21:50:19 +0000 (06:50 +0900)
committeraescling <aescling+gitlab@cat.family>
Thu, 17 Nov 2022 03:03:48 +0000 (22:03 -0500)
lib/mastodon/media_cli.rb

index 4904cc5eb99d5eab2d6378450fafe07d6cf8df26..bba4a1bd72f0e9df32b363491d74881fb329ef90 100644 (file)
@@ -234,7 +234,7 @@ module Mastodon
       end
 
       if options[:days].present?
-        scope = scope.where('id > ?', Mastodon::Snowflake.id_at(options[:days].days.ago, with_random: false))
+        scope = scope.where('media_attachments.id > ?', Mastodon::Snowflake.id_at(options[:days].days.ago, with_random: false))
       end
 
       processed, aggregate = parallelize_with_progress(scope) do |media_attachment|