method
indexes
indexes(table, stream)
private
Hide source
# File activerecord/lib/active_record/schema_dumper.rb, line 162 def indexes(table, stream) if (indexes = @connection.indexes(table)).any? add_index_statements = indexes.map do |index| statment_parts = [ ('add_index ' + index.table.inspect) ] statment_parts << index.columns.inspect statment_parts << (':name => ' + index.name.inspect) statment_parts << ':unique => true' if index.unique ' ' + statment_parts.join(', ') end stream.puts add_index_statements.sort.join("\n") stream.puts end end