FIX: Post migration to fix custom emojis with secure URL (#15944)
Follow up to 88a8584348
. Sets
the baked version of all posts with custom emoji and a secure
media URL in the cooked content to 0. Then our periodic rebake
posts job will rebake them to apply the fix in the linked
commit. This only matters on sites with secure media enabled.
This commit is contained in:
parent
16b1fcd95e
commit
ad9e791ba7
|
@ -0,0 +1,16 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ResetCustomEmojiPostBakesVersionSecureFix < ActiveRecord::Migration[6.1]
|
||||
def up
|
||||
if SiteSetting.secure_media
|
||||
execute <<~SQL
|
||||
UPDATE posts SET baked_version = 0
|
||||
WHERE cooked LIKE '%emoji emoji-custom%' AND cooked LIKE '%secure-media-uploads%'
|
||||
SQL
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
raise ActiveRecord::IrreversibleMigration
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue