diff options
author | Thomas Bianchini <thomas.bianchini@talent.io> | 2018-11-20 18:20:24 +0100 |
---|---|---|
committer | Thomas Bianchini <thomas.bianchini@talent.io> | 2018-11-21 14:29:19 +0100 |
commit | a6e0eeb8623168acd62edd23478368f04d25faa5 (patch) | |
tree | feccfe197fc3163b815e478ee3d041f992afb1a7 /activerecord/lib/active_record/connection_adapters/postgresql | |
parent | 536a190ab3690810a3b342b897f2585c4971229d (diff) | |
download | rails-a6e0eeb8623168acd62edd23478368f04d25faa5.tar.gz rails-a6e0eeb8623168acd62edd23478368f04d25faa5.tar.bz2 rails-a6e0eeb8623168acd62edd23478368f04d25faa5.zip |
Fixing an issue when parsing an opclass by allowing indexed column
in indexdef to be wrapped up by double quotes
Fixes #34493.
*Thomas Bianchini*
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/postgresql')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb index fae3ddbad4..f39e94ee7f 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb @@ -124,7 +124,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)?\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(" ") |