aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/schema_dumper_test.rb
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2017-04-16 05:17:14 +0900
committerRyuta Kamizono <kamipo@gmail.com>2017-04-16 07:58:10 +0900
commit606830d27a32fab23c0964b4383807fcdfdd7eba (patch)
tree7d057eaeeab90fbc3e7c8347d0ea9d99aabe0228 /activerecord/test/cases/schema_dumper_test.rb
parent1a92ae8318c3f5720907dec671d9ebb9221c0817 (diff)
downloadrails-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/test/cases/schema_dumper_test.rb')
-rw-r--r--activerecord/test/cases/schema_dumper_test.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/activerecord/test/cases/schema_dumper_test.rb b/activerecord/test/cases/schema_dumper_test.rb
index fccba4738f..cb8d449ba9 100644
--- a/activerecord/test/cases/schema_dumper_test.rb
+++ b/activerecord/test/cases/schema_dumper_test.rb
@@ -182,7 +182,11 @@ class SchemaDumperTest < ActiveRecord::TestCase
if current_adapter?(:PostgreSQLAdapter)
assert_equal 't.index ["firm_id", "type", "rating"], name: "company_index", order: { rating: :desc }', index_definition
elsif current_adapter?(:Mysql2Adapter)
- assert_equal 't.index ["firm_id", "type", "rating"], name: "company_index", length: { type: 10 }', index_definition
+ if ActiveRecord::Base.connection.supports_index_sort_order?
+ assert_equal 't.index ["firm_id", "type", "rating"], name: "company_index", length: { type: 10 }, order: { rating: :desc }', index_definition
+ else
+ assert_equal 't.index ["firm_id", "type", "rating"], name: "company_index", length: { type: 10 }', index_definition
+ end
else
assert_equal 't.index ["firm_id", "type", "rating"], name: "company_index"', index_definition
end