Permalink
Browse files

Added docs for #indexes on adapters

  • Loading branch information...
1 parent df70b9d commit 900470cf3cd346ad1b17cf6902f3f98e6dae7709 @smartinez87 smartinez87 committed Apr 22, 2011
@@ -611,6 +611,7 @@ def drop_table(table_name, options = {})
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 @@ def extract_schema_and_table(name)
[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 @@ def columns(table_name, name = nil) #:nodoc:
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(

0 comments on commit 900470c

Please sign in to comment.