Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
2f5ec1e5
Commit
2f5ec1e5
authored
May 16, 2022
by
Alexandru Croitor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix gin index detection on routes table
parent
e7b75f38
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
lib/gitlab/background_migration/backfill_namespace_id_for_project_route.rb
...ound_migration/backfill_namespace_id_for_project_route.rb
+6
-3
No files found.
lib/gitlab/background_migration/backfill_namespace_id_for_project_route.rb
View file @
2f5ec1e5
...
...
@@ -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
|
A
ctiveRecord
::
Base
.
connection
.
execute
(
"select
gin_clean_pending_list('
#{
index_name
}
')"
)
A
pplicationRecord
.
connection
.
execute
(
"SELECT
gin_clean_pending_list('
#{
index_name
}
')"
)
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment