diff options
author | Jamis Buck <jamis@37signals.com> | 2005-09-23 15:46:04 +0000 |
---|---|---|
committer | Jamis Buck <jamis@37signals.com> | 2005-09-23 15:46:04 +0000 |
commit | 9838a5f8b3f75f93d9d605cbf5f81e182c4bdb52 (patch) | |
tree | 4a4b2b424b52b526f9152dbbe2a614ee979d37d0 | |
parent | 6d4a4a0d2e0d9f64b7b123dafd3632876356ae3a (diff) | |
download | rails-9838a5f8b3f75f93d9d605cbf5f81e182c4bdb52.tar.gz rails-9838a5f8b3f75f93d9d605cbf5f81e182c4bdb52.tar.bz2 rails-9838a5f8b3f75f93d9d605cbf5f81e182c4bdb52.zip |
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
-rwxr-xr-x | activerecord/lib/active_record/connection_adapters/abstract_adapter.rb | 4 | ||||
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb | 10 |
2 files changed, 10 insertions, 4 deletions
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 |