mirror of
https://github.com/discourse/discourse.git
synced 2025-03-09 14:34:35 +00:00
FIX: Post migration to fix custom emojis with secure URL
Follow up to 88a8584348ed93a28286839bfc1c32b06bd50b3f. 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
ebb5c1ff4d
commit
21a356e3af
@ -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…
x
Reference in New Issue
Block a user