mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 14:52:46 +08:00
DEV: Drop old SSO site setting rows from the database (#12148)
These were copied to their new names in 821bb1e8cb
This commit is contained in:
parent
5a22c5fdac
commit
b22ea7911c
|
@ -25,7 +25,7 @@ class RenameSsoSiteSettings < ActiveRecord::Migration[6.0]
|
|||
|
||||
def up
|
||||
# Copying the rows so that things keep working during deploy
|
||||
# TODO: Add a post-deploy migration to drop the old rows
|
||||
# They will be dropped in post_migrate/20210219171329_drop_old_sso_site_settings
|
||||
|
||||
RENAME_SETTINGS.each do |old_name, new_name|
|
||||
execute <<~SQL
|
||||
|
|
35
db/post_migrate/20210219171329_drop_old_sso_site_settings.rb
Normal file
35
db/post_migrate/20210219171329_drop_old_sso_site_settings.rb
Normal file
|
@ -0,0 +1,35 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class DropOldSsoSiteSettings < ActiveRecord::Migration[6.0]
|
||||
def up
|
||||
# These were copied to their new names in migrate/20210204135429_rename_sso_site_settings
|
||||
execute <<~SQL
|
||||
DELETE FROM site_settings
|
||||
WHERE name IN (
|
||||
'enable_sso',
|
||||
'sso_allows_all_return_paths',
|
||||
'enable_sso_provider',
|
||||
'verbose_sso_logging',
|
||||
'sso_url',
|
||||
'sso_secret',
|
||||
'sso_provider_secrets',
|
||||
'sso_overrides_groups',
|
||||
'sso_overrides_bio',
|
||||
'sso_overrides_email',
|
||||
'sso_overrides_username',
|
||||
'sso_overrides_name',
|
||||
'sso_overrides_avatar',
|
||||
'sso_overrides_profile_background',
|
||||
'sso_overrides_location',
|
||||
'sso_overrides_website',
|
||||
'sso_overrides_card_background',
|
||||
'external_auth_skip_create_confirm',
|
||||
'external_auth_immediately'
|
||||
)
|
||||
SQL
|
||||
end
|
||||
|
||||
def down
|
||||
raise ActiveRecord::IrreversibleMigration
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user