Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,5 @@ class AddEmailNameIdFormatToServiceProviders < ActiveRecord::Migration[6.1]
def change
add_column :service_providers, :email_nameid_format_allowed, :boolean
change_column_default :service_providers, :email_nameid_format_allowed, from: nil, to: false

reversible do |dir|
dir.up do
if IdentityConfig.store.respond_to?(:issuers_with_email_nameid_format)
issuers = IdentityConfig.store.issuers_with_email_nameid_format
unless issuers.empty?
query = <<~SQL
UPDATE service_providers
SET email_nameid_format_allowed = 't'
WHERE issuer in (#{issuers.map { |i| "'#{i}'" }.join(', ')})
SQL
ActiveRecord::Base.connection.execute(query)
end
end
end
end
end
end