Add documentation for nulls_not_distinct

Adds API documentation for the nulls_not_distinct option for
ActiveRecord::ConnectionAdapters::SchemaStatements.add_index.

Resolves issue #52852.
This commit is contained in:
jgsheppa 2024-09-24 14:20:03 +00:00
parent fd975a8775
commit add6b17792
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')