diff options
author | Jarek Radosz <jradosz@gmail.com> | 2012-11-19 01:00:38 +0100 |
---|---|---|
committer | Jarek Radosz <jradosz@gmail.com> | 2012-11-19 02:10:28 +0100 |
commit | 1a782b2b634cadbea2ae194848e97ca0ecdbce30 (patch) | |
tree | c56300df07949f6d9180876a57c9e0b228c5fce2 /activerecord/lib | |
parent | e21579f1d11983ab3296e530afafd836d6e29b1f (diff) | |
download | rails-1a782b2b634cadbea2ae194848e97ca0ecdbce30.tar.gz rails-1a782b2b634cadbea2ae194848e97ca0ecdbce30.tar.bz2 rails-1a782b2b634cadbea2ae194848e97ca0ecdbce30.zip |
Add rename_index to change_table.
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb index 38960ab873..7ec6abbc45 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb @@ -324,6 +324,7 @@ module ActiveRecord # change_table :table do |t| # t.column # t.index + # t.rename_index # t.timestamps # t.change # t.change_default @@ -386,6 +387,13 @@ module ActiveRecord @base.index_exists?(@table_name, column_name, options) end + # Renames the given index on the table. + # + # t.rename_index(:user_id, :account_id) + def rename_index(index_name, new_index_name) + @base.rename_index(@table_name, index_name, new_index_name) + end + # Adds timestamps (+created_at+ and +updated_at+) columns to the table. See SchemaStatements#add_timestamps # # t.timestamps |