Skip to content
代码片段 群组 项目
提交 2054d59b 编辑于 作者: Patrick Bair's avatar Patrick Bair 提交者: 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
上级 3c813b29
No related branches found
No related tags found
无相关合并请求
...@@ -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 @@ def has_unique_index_on_importable_fk? ...@@ -300,7 +300,7 @@ def has_unique_index_on_importable_fk?
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)
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册