Skip to content
Snippets Groups Projects
Commit ec32d780 authored by Graeme Gillies's avatar Graeme Gillies
Browse files

Merge branch 'fix-gin-index-detection-on-routes-14-10' into '14-10-stable-ee'

Fix gin index detection on routes table

See merge request gitlab-org/gitlab!87648
parents e7b75f38 2f5ec1e5
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment