aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/schema
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-10-25 07:29:51 +0900
committerRyuta Kamizono <kamipo@gmail.com>2018-10-25 18:09:02 +0900
commitd496055b5b75387136bcdd1cc93aeab14dbda606 (patch)
tree232e12f4d7b3800386f51fb09c5387699b84f8b1 /activerecord/test/schema
parentd76d66fb554fc3267de93d780344815d05ae6533 (diff)
downloadrails-d496055b5b75387136bcdd1cc93aeab14dbda606.tar.gz
rails-d496055b5b75387136bcdd1cc93aeab14dbda606.tar.bz2
rails-d496055b5b75387136bcdd1cc93aeab14dbda606.zip
Support expression indexes for MySQL
MySQL 8.0.13 and higher supports functional key parts that index expression values rather than column or column prefix values. https://dev.mysql.com/doc/refman/8.0/en/create-index.html
Diffstat (limited to 'activerecord/test/schema')
-rw-r--r--activerecord/test/schema/schema.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/test/schema/schema.rb b/activerecord/test/schema/schema.rb
index 4ef463fdad..56ff81af29 100644
--- a/activerecord/test/schema/schema.rb
+++ b/activerecord/test/schema/schema.rb
@@ -216,7 +216,7 @@ ActiveRecord::Schema.define do
t.index [:firm_id, :type, :rating], name: "company_index", length: { type: 10 }, order: { rating: :desc }
t.index [:firm_id, :type], name: "company_partial_index", where: "(rating > 10)"
t.index :name, name: "company_name_index", using: :btree
- t.index "(CASE WHEN rating > 0 THEN lower(name) END)", name: "company_expression_index" if supports_expression_index?
+ t.index "(CASE WHEN rating > 0 THEN lower(name) END) DESC", name: "company_expression_index" if supports_expression_index?
end
create_table :content, force: true do |t|