mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #45089 from fatkodima/fix-opclass-parsing-postgres
Fix parsing operator classes for index columns in PostgreSQL
This commit is contained in:
commit
445d400a65
1 changed files with 1 additions and 1 deletions
|
@ -125,7 +125,7 @@ module ActiveRecord
|
|||
|
||||
# add info on sort order (only desc order is explicitly specified, asc is the default)
|
||||
# and non-default opclasses
|
||||
expressions.scan(/(?<column>\w+)"?\s?(?<opclass>\w+_ops)?\s?(?<desc>DESC)?\s?(?<nulls>NULLS (?:FIRST|LAST))?/).each do |column, opclass, desc, nulls|
|
||||
expressions.scan(/(?<column>\w+)"?\s?(?<opclass>\w+_ops(_\w+)?)?\s?(?<desc>DESC)?\s?(?<nulls>NULLS (?:FIRST|LAST))?/).each do |column, opclass, desc, nulls|
|
||||
opclasses[column] = opclass.to_sym if opclass
|
||||
if nulls
|
||||
orders[column] = [desc, nulls].compact.join(" ")
|
||||
|
|
Loading…
Reference in a new issue