Check for table instead of class

This commit is contained in:
Dmitriy Zaporozhets 2015-04-13 12:26:04 +03:00
parent f64db1fab9
commit 04f05ac1fb

View file

@ -17,7 +17,7 @@ class FixIdentities < ActiveRecord::Migration
# Update legacy identities # Update legacy identities
execute "UPDATE identities SET provider = '#{new_provider}' WHERE provider = 'ldap';" execute "UPDATE identities SET provider = '#{new_provider}' WHERE provider = 'ldap';"
if defined?(LdapGroupLink) if table_exists?('ldap_group_links')
execute "UPDATE ldap_group_links SET provider = '#{new_provider}' WHERE provider IS NULL;" execute "UPDATE ldap_group_links SET provider = '#{new_provider}' WHERE provider IS NULL;"
end end
end end