mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Remove use of Discourse application code in migration. (#16068)
This makes the migration less brittle to changes in the future.
Follow-up to 21a356e3af
This commit is contained in:
parent
6f6406ea03
commit
e613aef419
@ -2,7 +2,9 @@
|
|||||||
|
|
||||||
class ResetCustomEmojiPostBakesVersionSecureFix < ActiveRecord::Migration[6.1]
|
class ResetCustomEmojiPostBakesVersionSecureFix < ActiveRecord::Migration[6.1]
|
||||||
def up
|
def up
|
||||||
if SiteSetting.secure_media
|
secure_media_enabled = DB.query_single("SELECT value FROM site_settings WHERE name = 'secure_media'")
|
||||||
|
|
||||||
|
if secure_media_enabled.present? && secure_media_enabled[0] == "t"
|
||||||
execute <<~SQL
|
execute <<~SQL
|
||||||
UPDATE posts SET baked_version = 0
|
UPDATE posts SET baked_version = 0
|
||||||
WHERE cooked LIKE '%emoji emoji-custom%' AND cooked LIKE '%secure-media-uploads%'
|
WHERE cooked LIKE '%emoji emoji-custom%' AND cooked LIKE '%secure-media-uploads%'
|
||||||
|
Loading…
Reference in New Issue
Block a user