Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-04-13 12:26:04 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-04-13 12:26:14 +0300
commit04f05ac1fb43904229bc084813dab92e82343f02 (patch)
tree755fd96b9de3f76e45fafcce2c0a7f59dcc7221e /db/migrate/20150411000035_fix_identities.rb
parentf64db1fab95751bc2b1cf04641bb031d6289d16b (diff)
Check for table instead of class
Diffstat (limited to 'db/migrate/20150411000035_fix_identities.rb')
-rw-r--r--db/migrate/20150411000035_fix_identities.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/db/migrate/20150411000035_fix_identities.rb b/db/migrate/20150411000035_fix_identities.rb
index b65ad138b0f..e86264b166a 100644
--- a/db/migrate/20150411000035_fix_identities.rb
+++ b/db/migrate/20150411000035_fix_identities.rb
@@ -11,13 +11,13 @@ class FixIdentities < ActiveRecord::Migration
# the first LDAP server specified in gitlab.yml / gitlab.rb.
new_provider = Gitlab.config.ldap.servers.first.last['provider_name']
- # Delete duplicate identities
+ # Delete duplicate identities
execute "DELETE FROM identities WHERE provider = 'ldap' AND user_id IN (SELECT user_id FROM identities WHERE provider = '#{new_provider}')"
# Update legacy identities
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;"
end
end