summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-05-17 23:40:18 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-05-17 23:40:18 +0000
commitbcacf1a2373a3e79b974e6a59cfcd2fef53768d6 (patch)
tree3a84893c6f21ea98a12363174cbd4b7ecf1f54fe
parent1c00e4b51fab6ea32433a37eb2316cb294b505f7 (diff)
downloadgitlab-ce-bcacf1a2373a3e79b974e6a59cfcd2fef53768d6.tar.gz
Add latest changes from gitlab-org/gitlab@14-10-stable-ee
-rw-r--r--lib/gitlab/background_migration/backfill_namespace_id_for_project_route.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/gitlab/background_migration/backfill_namespace_id_for_project_route.rb b/lib/gitlab/background_migration/backfill_namespace_id_for_project_route.rb
index 1f0d606f001..f6c8fb060f8 100644
--- a/lib/gitlab/background_migration/backfill_namespace_id_for_project_route.rb
+++ b/lib/gitlab/background_migration/backfill_namespace_id_for_project_route.rb
@@ -36,11 +36,14 @@ module Gitlab
private
def cleanup_gin_index(table_name)
- sql = "select indexname::text from pg_indexes where tablename = '#{table_name}' and indexdef ilike '%gin%'"
- index_names = ActiveRecord::Base.connection.select_values(sql)
+ sql = <<-SQL
+ SELECT indexname::text FROM pg_indexes WHERE tablename = '#{table_name}' AND indexdef ILIKE '%using gin%'
+ SQL
+
+ index_names = ApplicationRecord.connection.select_values(sql)
index_names.each do |index_name|
- ActiveRecord::Base.connection.execute("select gin_clean_pending_list('#{index_name}')")
+ ApplicationRecord.connection.execute("SELECT gin_clean_pending_list('#{index_name}')")
end
end