DEV: Update Discord webhook domain (#106)
discordapp.com is being deprecated and replaced with discord.com - https://github.com/discord/discord-api-docs/discussions/4510
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class UpdateDiscordWebhookDomains < ActiveRecord::Migration[6.1]
|
||||
def up
|
||||
execute <<~SQL
|
||||
UPDATE plugin_store_rows psr
|
||||
SET value = REPLACE(value, 'discordapp.com', 'discord.com')
|
||||
WHERE psr.plugin_name = 'discourse-chat-integration'
|
||||
AND psr.key LIKE 'channel:%'
|
||||
AND psr.type_name = 'JSON'
|
||||
AND psr.value::json ->> 'provider' = 'discord'
|
||||
AND psr.value::json ->> 'data' LIKE '%https://discordapp.com/%'
|
||||
SQL
|
||||
end
|
||||
|
||||
def down
|
||||
raise ActiveRecord::IrreversibleMigration
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user