diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-11-18 17:14:07 -0800 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-11-18 17:14:07 -0800 |
commit | f460835dd5ebcede6f02e0459a7e6f8271b9047c (patch) | |
tree | c56300df07949f6d9180876a57c9e0b228c5fce2 /activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb | |
parent | e21579f1d11983ab3296e530afafd836d6e29b1f (diff) | |
parent | 1a782b2b634cadbea2ae194848e97ca0ecdbce30 (diff) | |
download | rails-f460835dd5ebcede6f02e0459a7e6f8271b9047c.tar.gz rails-f460835dd5ebcede6f02e0459a7e6f8271b9047c.tar.bz2 rails-f460835dd5ebcede6f02e0459a7e6f8271b9047c.zip |
Merge pull request #8266 from CvX/index_rename
Add rename_index to change_table.
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb')
-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 |