diff options
author | Matthew Draper <matthew@trebex.net> | 2017-04-17 02:58:52 +0930 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-17 02:58:52 +0930 |
commit | e1e3be7c02acb0facbf81a97bbfe6d1a6e9ca598 (patch) | |
tree | 5640f0f52e7f19bc349abb3127cff6ea4437b305 /activerecord/test | |
parent | 01caad190f8f6aa1fe36f1cda764f22b6df72e22 (diff) | |
parent | 606830d27a32fab23c0964b4383807fcdfdd7eba (diff) | |
download | rails-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')
-rw-r--r-- | activerecord/test/cases/schema_dumper_test.rb | 6 |
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 |