From bcacf1a2373a3e79b974e6a59cfcd2fef53768d6 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 17 May 2022 23:40:18 +0000 Subject: Add latest changes from gitlab-org/gitlab@14-10-stable-ee --- .../backfill_namespace_id_for_project_route.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib') 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 -- cgit v1.2.1