mirror of
https://github.com/discourse/discourse.git
synced 2026-03-03 23:54:20 +08:00
We can use the status of upcoming changes to indicate whether they are experimental or not, having experimental in the setting name is redundant. Migrates the settings and the upcoming change events, updates code, and updates yaml translation keys.
21 lines
528 B
Ruby
21 lines
528 B
Ruby
# frozen_string_literal: true
|
|
|
|
class RenameExperimentalImpersonationSetting < ActiveRecord::Migration[8.0]
|
|
def up
|
|
execute <<~SQL
|
|
UPDATE site_settings
|
|
SET name = 'impersonate_without_logout'
|
|
WHERE name = 'experimental_impersonation'
|
|
SQL
|
|
|
|
execute <<~SQL
|
|
UPDATE upcoming_change_events
|
|
SET upcoming_change_name = 'impersonate_without_logout'
|
|
WHERE upcoming_change_name = 'experimental_impersonation'
|
|
SQL
|
|
end
|
|
|
|
def down
|
|
raise ActiveRecord::IrreversibleMigration
|
|
end
|
|
end
|