diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-04-16 05:17:14 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2017-04-16 07:58:10 +0900 |
commit | 606830d27a32fab23c0964b4383807fcdfdd7eba (patch) | |
tree | 7d057eaeeab90fbc3e7c8347d0ea9d99aabe0228 /activerecord/lib/active_record/connection_adapters/mysql/schema_statements.rb | |
parent | 1a92ae8318c3f5720907dec671d9ebb9221c0817 (diff) | |
download | rails-606830d27a32fab23c0964b4383807fcdfdd7eba.tar.gz rails-606830d27a32fab23c0964b4383807fcdfdd7eba.tar.bz2 rails-606830d27a32fab23c0964b4383807fcdfdd7eba.zip |
Support Descending Indexes for MySQL
MySQL 8.0.1 and higher supports descending indexes: `DESC` in an index
definition is no longer ignored.
See https://dev.mysql.com/doc/refman/8.0/en/descending-indexes.html.
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/mysql/schema_statements.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/mysql/schema_statements.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/mysql/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/mysql/schema_statements.rb index 1e58513387..571edffec7 100644 --- a/activerecord/lib/active_record/connection_adapters/mysql/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/mysql/schema_statements.rb @@ -38,6 +38,7 @@ module ActiveRecord indexes.last.columns << row[:Column_name] indexes.last.lengths.merge!(row[:Column_name] => row[:Sub_part].to_i) if row[:Sub_part] + indexes.last.orders.merge!(row[:Column_name] => :desc) if row[:Collation] == "D" end end |