Method: ActiveRecord::ConnectionAdapters::SchemaStatements#build_create_index_definition

Defined in:
activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb

#build_create_index_definition(table_name, column_name, **options) ⇒ Object

Builds a CreateIndexDefinition object.

This definition object contains information about the index that would be created if the same arguments were passed to #add_index. See #add_index for information about passing a table_name, column_name, and other additional options that can be passed.



925
926
927
928
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb', line 925

def build_create_index_definition(table_name, column_name, **options) # :nodoc:
  index, algorithm, if_not_exists = add_index_options(table_name, column_name, **options)
  CreateIndexDefinition.new(index, algorithm, if_not_exists)
end