mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-04-30 11:07:08 +08:00
This promotes all post-migrations which existed in `v2026.1` to regular pre-deploy migrations. We do this after each stable/esr release to reduce the probability of pre/post deploy timing issues.
24 lines
578 B
Ruby
24 lines
578 B
Ruby
# frozen_string_literal: true
|
|
|
|
class DisableGravatarEnabledIfUnconfigured < ActiveRecord::Migration[7.2]
|
|
def up
|
|
execute <<~SQL
|
|
INSERT INTO site_settings (name, data_type, value, created_at, updated_at)
|
|
SELECT 'gravatar_enabled', 5, 'f', 'NOW()', 'NOW()'
|
|
WHERE EXISTS (
|
|
SELECT 1
|
|
FROM site_settings
|
|
WHERE name = 'gravatar_base_url' AND (
|
|
VALUE = '' OR
|
|
VALUE IS NULL
|
|
)
|
|
LIMIT 1
|
|
)
|
|
ON CONFLICT DO NOTHING;
|
|
SQL
|
|
end
|
|
|
|
def down
|
|
raise ActiveRecord::IrreversibleMigration
|
|
end
|
|
end
|