f5c1222660
Adds `:using_index` option to use an existing index when defining a unique constraint. If you want to change an existing unique index to deferrable, you can use :using_index to create deferrable unique constraints. ```ruby add_unique_key :users, deferrable: :immediate, using_index: 'unique_index_name' ``` A unique constraint internally constructs a unique index. If an existing unique index has already been created, the unique constraint can be created much faster, since there is no need to create the unique index when generating the constraint. |
||
---|---|---|
.. | ||
active_record | ||
arel | ||
rails/generators | ||
active_record.rb | ||
arel.rb |