mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Added docs for #indexes on adapters
This commit is contained in:
@@ -611,6 +611,7 @@ module ActiveRecord
|
||||
super(table_name, options)
|
||||
end
|
||||
|
||||
# Returns an array of indexes for the given table.
|
||||
def indexes(table_name, name = nil)#:nodoc:
|
||||
indexes = []
|
||||
current_index = nil
|
||||
|
||||
@@ -690,7 +690,7 @@ module ActiveRecord
|
||||
[schema, table]
|
||||
end
|
||||
|
||||
# Returns the list of all indexes for a table.
|
||||
# Returns an array of indexes for the given table.
|
||||
def indexes(table_name, name = nil)
|
||||
schemas = schema_search_path.split(/,/).map { |p| quote(p) }.join(',')
|
||||
result = query(<<-SQL, name)
|
||||
|
||||
@@ -263,6 +263,7 @@ module ActiveRecord
|
||||
end
|
||||
end
|
||||
|
||||
# Returns an array of indexes for the given table.
|
||||
def indexes(table_name, name = nil) #:nodoc:
|
||||
exec_query("PRAGMA index_list(#{quote_table_name(table_name)})", name).map do |row|
|
||||
IndexDefinition.new(
|
||||
|
||||
Reference in New Issue
Block a user