Commit 2054d59b authored by Patrick Bair's avatar Patrick Bair Committed by Luke Duncalfe

Fix usage of ActiveRecord::Base in importer code

Use the connection from the associated relation class rather than
ActiveRecord::Base when doing an index check.

https://gitlab.com/gitlab-org/gitlab/-/issues/350191
parent 3c813b29
...@@ -20,7 +20,6 @@ Database/MultipleDatabases: ...@@ -20,7 +20,6 @@ Database/MultipleDatabases:
- lib/gitlab/database.rb - lib/gitlab/database.rb
- lib/gitlab/gitlab_import/importer.rb - lib/gitlab/gitlab_import/importer.rb
- lib/gitlab/health_checks/db_check.rb - lib/gitlab/health_checks/db_check.rb
- lib/gitlab/import_export/base/relation_factory.rb
- lib/gitlab/import_export/group/relation_tree_restorer.rb - lib/gitlab/import_export/group/relation_tree_restorer.rb
- lib/gitlab/legacy_github_import/importer.rb - lib/gitlab/legacy_github_import/importer.rb
- lib/gitlab/seeder.rb - lib/gitlab/seeder.rb
......
...@@ -300,7 +300,7 @@ module Gitlab ...@@ -300,7 +300,7 @@ module Gitlab
return cache[table_name] if cache.has_key?(table_name) return cache[table_name] if cache.has_key?(table_name)
index_exists = index_exists =
ActiveRecord::Base.connection.index_exists?( relation_class.connection.index_exists?(
relation_class.table_name, relation_class.table_name,
importable_foreign_key, importable_foreign_key,
unique: true) unique: true)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment