Skip to content

Commit df943c8

Browse files
authored
Merge pull request rails#50432 from fatkodima/better-docs-for-add_exclusion_constraint
Document missing `:using` and `:where` options for `add_exclusion_constraint` [skip ci]
2 parents 84f773f + 853cd14 commit df943c8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,10 @@ def unique_constraints(table_name)
690690
# The constraint name. Defaults to <tt>excl_rails_<identifier></tt>.
691691
# [<tt>:deferrable</tt>]
692692
# Specify whether or not the exclusion constraint should be deferrable. Valid values are +false+ or +:immediate+ or +:deferred+ to specify the default behavior. Defaults to +false+.
693+
# [<tt>:using</tt>]
694+
# Specify which index method to use when creating this exclusion constraint (e.g. +:btree+, +:gist+ etc).
695+
# [<tt>:where</tt>]
696+
# Specify an exclusion constraint on a subset of the table (internally PostgreSQL creates a partial index for this).
693697
def add_exclusion_constraint(table_name, expression, **options)
694698
options = exclusion_constraint_options(table_name, expression, options)
695699
at = create_alter_table(table_name)

0 commit comments

Comments
 (0)