diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-18 15:05:29 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-19 10:24:15 -0800 |
commit | 24b637a80f659eb03f8efe459f9d6aae2338e434 (patch) | |
tree | 115c3443f91d6f76d8da43c4f0460f695195b329 | |
parent | 843e319f78631d056e5018a690d0e16fc4dee619 (diff) | |
download | rails-24b637a80f659eb03f8efe459f9d6aae2338e434.tar.gz rails-24b637a80f659eb03f8efe459f9d6aae2338e434.tar.bz2 rails-24b637a80f659eb03f8efe459f9d6aae2338e434.zip |
inverting add_index
-rw-r--r-- | activerecord/lib/active_record/migration/command_recorder.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/migration/command_recorder.rb b/activerecord/lib/active_record/migration/command_recorder.rb index 25b8649350..032ce3aad8 100644 --- a/activerecord/lib/active_record/migration/command_recorder.rb +++ b/activerecord/lib/active_record/migration/command_recorder.rb @@ -43,6 +43,11 @@ module ActiveRecord def invert_rename_column(args) [:rename_column, [args.first] + args.last(2).reverse] end + + def invert_add_index(args) + table, columns, _ = *args + [:remove_index, [table, {:column => columns}]] + end end end end |