Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Post the postgresql adapter (and hopefully other adapters) pass all t…

…ests

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2316 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 9838a5f8b3f75f93d9d605cbf5f81e182c4bdb52 1 parent 6d4a4a0
@jamis jamis authored
View
4 activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
@@ -276,10 +276,10 @@ def select_all(sql, name = nil) end
def select_one(sql, name = nil) end
# Returns an array of table names for the current database.
- def tables(name = nil) end
+ # def tables(name = nil) end
# Returns an array of indexes for the given table.
- def indexes(table_name, name = nil) end
+ # def indexes(table_name, name = nil) end
# Returns an array of column objects for the table specified by +table_name+.
def columns(table_name, name = nil) end
View
10 activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -163,8 +163,14 @@ def rename_column(table_name, column_name, new_column_name)
execute "ALTER TABLE #{table_name} RENAME COLUMN #{column_name} TO #{new_column_name}"
end
- def remove_index(table_name, column_name)
- execute "DROP INDEX #{table_name}_#{column_name}_index"
+ def remove_index(table_name, options)
+ if Hash === options
+ index_name = options[:name]
+ else
+ index_name = "#{table_name}_#{options}_index"
+ end
+
+ execute "DROP INDEX #{index_name}"
end
private
Please sign in to comment.
Something went wrong with that request. Please try again.