diff options
Diffstat (limited to 'activerecord')
-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 |