aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2017-04-17 02:58:52 +0930
committerGitHub <noreply@github.com>2017-04-17 02:58:52 +0930
commite1e3be7c02acb0facbf81a97bbfe6d1a6e9ca598 (patch)
tree5640f0f52e7f19bc349abb3127cff6ea4437b305 /activerecord/test/cases
parent01caad190f8f6aa1fe36f1cda764f22b6df72e22 (diff)
parent606830d27a32fab23c0964b4383807fcdfdd7eba (diff)
downloadrails-e1e3be7c02acb0facbf81a97bbfe6d1a6e9ca598.tar.gz
rails-e1e3be7c02acb0facbf81a97bbfe6d1a6e9ca598.tar.bz2
rails-e1e3be7c02acb0facbf81a97bbfe6d1a6e9ca598.zip
Merge pull request #28773 from kamipo/support_descending_indexes
Support Descending Indexes for MySQL
Diffstat (limited to 'activerecord/test/cases')
-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