mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: use upload id to save in theme setting instead of URL. (#14341)
When we use URL instead it creates the problem while changing the CDN hostname.
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class UpdateValueOnThemeSettingForUploadType < ActiveRecord::Migration[6.1]
|
||||
def up
|
||||
execute <<~SQL
|
||||
UPDATE theme_settings
|
||||
SET value = (SELECT id FROM uploads WHERE uploads.url = theme_settings.value)
|
||||
WHERE data_type = 6
|
||||
SQL
|
||||
end
|
||||
|
||||
def down
|
||||
execute <<~SQL
|
||||
UPDATE theme_settings
|
||||
SET value = (SELECT url FROM uploads WHERE uploads.id = theme_settings.value)
|
||||
WHERE data_type = 6
|
||||
SQL
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user