From 9838a5f8b3f75f93d9d605cbf5f81e182c4bdb52 Mon Sep 17 00:00:00 2001 From: Jamis Buck Date: Fri, 23 Sep 2005 15:46:04 +0000 Subject: Post the postgresql adapter (and hopefully other adapters) pass all tests git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2316 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../lib/active_record/connection_adapters/abstract_adapter.rb | 4 ++-- .../active_record/connection_adapters/postgresql_adapter.rb | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb index 1d09fa0f37..a1a71afb5b 100755 --- a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb @@ -276,10 +276,10 @@ module ActiveRecord 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 diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index 25539e2617..165c09cead 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -163,8 +163,14 @@ module ActiveRecord 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 -- cgit v1.2.3