aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorJo Liss <joliss42@gmail.com>2011-12-27 13:18:34 +0100
committerVijay Dev <vijaydev.cse@gmail.com>2011-12-29 23:39:06 +0530
commitd8a43e26500335d54679aab42bafbce39eb71da5 (patch)
treeb2c41f92ddaba605b7634199d893b22486228c66 /activerecord
parentbea4f9aa3f8f2e2c4fd1502f013a08318fdc0804 (diff)
downloadrails-d8a43e26500335d54679aab42bafbce39eb71da5.tar.gz
rails-d8a43e26500335d54679aab42bafbce39eb71da5.tar.bz2
rails-d8a43e26500335d54679aab42bafbce39eb71da5.zip
Document that index names are made up of all columns, not just the first.
index_name has been using the following expression "index_#{table_name}_on_#{Array.wrap(options[:column]) * '_and_'}" since at least 2006 (bc7f2315), and that's how they come out in my DB. Please check that this is correct before merging into master, perhaps I'm misunderstanding the section I changed.
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb11
1 files changed, 2 insertions, 9 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
index ccbeba061d..20d3b4a1ef 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
@@ -301,15 +301,8 @@ module ActiveRecord
# Adds a new index to the table. +column_name+ can be a single Symbol, or
# an Array of Symbols.
#
- # The index will be named after the table and the first column name,
- # unless you pass <tt>:name</tt> as an option.
- #
- # When creating an index on multiple columns, the first column is used as a name
- # for the index. For example, when you specify an index on two columns
- # [<tt>:first</tt>, <tt>:last</tt>], the DBMS creates an index for both columns as well as an
- # index for the first column <tt>:first</tt>. Using just the first name for this index
- # makes sense, because you will never have to create a singular index with this
- # name.
+ # The index will be named after the table and the column name(s), unless
+ # you pass <tt>:name</tt> as an option.
#
# ===== Examples
#