mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
docs, link MySQL manual for multi column indexes. [ci ckip].
Closes #9131.
This commit is contained in:
parent
702e0e1a6b
commit
c7abc516f8
1 changed files with 3 additions and 1 deletions
|
@ -575,7 +575,9 @@ This helper validates that the attribute's value is unique right before the
|
||||||
object gets saved. It does not create a uniqueness constraint in the database,
|
object gets saved. It does not create a uniqueness constraint in the database,
|
||||||
so it may happen that two different database connections create two records
|
so it may happen that two different database connections create two records
|
||||||
with the same value for a column that you intend to be unique. To avoid that,
|
with the same value for a column that you intend to be unique. To avoid that,
|
||||||
you must create a unique index in your database.
|
you must create a unique index on both columns in your database. See
|
||||||
|
[the MySQL manual](http://dev.mysql.com/doc/refman/5.6/en/multiple-column-indexes.html)
|
||||||
|
for more details about multi column indexes.
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class Account < ActiveRecord::Base
|
class Account < ActiveRecord::Base
|
||||||
|
|
Loading…
Reference in a new issue