Merge pull request #53029 from jgsheppa/52852_nulls_not_distinct_documentation

Add documentation for `nulls_not_distinct` option to `add_index` [ci skip]
This commit is contained in:
fatkodima 2024-09-24 20:39:52 +03:00 committed by GitHub
commit 5ff57a5e90
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 0 deletions

View File

@ -855,6 +855,16 @@ module ActiveRecord
#
# Note: only supported by PostgreSQL.
#
# ====== Creating an index where NULLs are treated equally
#
# add_index(:people, :last_name, nulls_not_distinct: true)
#
# generates:
#
# CREATE INDEX index_people_on_last_name ON people (last_name) NULLS NOT DISTINCT
#
# Note: only supported by PostgreSQL version 15.0.0 and greater.
#
# ====== Creating an index with a specific method
#
# add_index(:developers, :name, using: 'btree')