class ActiveRecord::ConnectionAdapters::IndexDefinition

:nodoc:
adapters. e.g. ActiveRecord::ConnectionAdapters::MySQL::SchemaStatements#indexes
this type are typically created and returned by methods in database
Abstract representation of an index definition on a table. Instances of
:nodoc:

def column_options

def column_options
  {
    length: lengths,
    order: orders,
    opclass: opclasses,
  }
end

def concise_options(options)

def concise_options(options)
  if columns.size == options.size && options.values.uniq.size == 1
    options.values.first
  else
    options
  end
end

def initialize(

def initialize(
  table, name,
  unique = false,
  columns = [],
  lengths: {},
  orders: {},
  opclasses: {},
  where: nil,
  type: nil,
  using: nil,
  comment: nil
)
  @table = table
  @name = name
  @unique = unique
  @columns = columns
  @lengths = concise_options(lengths)
  @orders = concise_options(orders)
  @opclasses = concise_options(opclasses)
  @where = where
  @type = type
  @using = using
  @comment = comment
end