summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2017-09-19 14:11:48 +0000
committerYorick Peterse <yorickpeterse@gmail.com>2017-09-19 14:11:48 +0000
commit7e69f1889b1e7d86aee4faf01089a32eda35786c (patch)
treef8aa33d2b9ee903708dded473c58d7689970ce68 /config
parentc74f9a998f9ea1dafd85331e6089016f9ca1fd3f (diff)
parent46114fca5dd0f29ba4a98c715c15bd0895b07b0c (diff)
downloadgitlab-ce-7e69f1889b1e7d86aee4faf01089a32eda35786c.tar.gz
Merge branch 'fix-rails-migrations-for-partial-indexes' into 'master'
Fix regular expression used for opclasses to not be confused by partial index clause See merge request gitlab-org/gitlab-ce!14343
Diffstat (limited to 'config')
-rw-r--r--config/initializers/postgresql_opclasses_support.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/config/initializers/postgresql_opclasses_support.rb b/config/initializers/postgresql_opclasses_support.rb
index 820cc89ef57..c2f3023b330 100644
--- a/config/initializers/postgresql_opclasses_support.rb
+++ b/config/initializers/postgresql_opclasses_support.rb
@@ -127,7 +127,7 @@ module ActiveRecord
orders = desc_order_columns.any? ? Hash[desc_order_columns.map {|order_column| [order_column, :desc]}] : {}
where = inddef.scan(/WHERE (.+)$/).flatten[0]
using = inddef.scan(/USING (.+?) /).flatten[0].to_sym
- opclasses = Hash[inddef.scan(/\((.+)\)$/).flatten[0].split(',').map do |column_and_opclass|
+ opclasses = Hash[inddef.scan(/\((.+?)\)(?:$| WHERE )/).flatten[0].split(',').map do |column_and_opclass|
column, opclass = column_and_opclass.split(' ').map(&:strip)
[column, opclass] if opclass
end.compact]