This project is archived and is in readonly mode.
migrations for add_index and remove_index don't match
Reported by Tim Haines | July 7th, 2008 @ 11:54 PM | in 2.x
Looking at the documentation here -> http://api.rubyonrails.org/class...
Says:
- add_index(table_name, column_names, options): Adds a new index with the name of the column. Other options include :name and :unique (e.g. { :name => "users_name_index", :unique => true }).
- remove_index(table_name, index_name): Removes the index specified by index_name.
The documentation for remove_index is misleading. It implies that if you've added an index with add_index and supplied :name, then you use that :name in remove_index to remove the index. This isn't true.
If you add_index for :table, :column, you can remove_index for :table, :column - but not :table, :index_name
Comments and changes to this ticket
-
Pratik July 16th, 2008 @ 11:40 PM
- State changed from new to invalid
-
Tim Haines July 16th, 2008 @ 11:43 PM
Did you mark it as invalid simply because it relates to documentation?
-
Tim Haines July 16th, 2008 @ 11:57 PM
Have you moved the ticket to another issue tracker?
I don't know whether this ticket should result in a change of documentation or a change of the way the documented features work. I think it would be nice if the documentation stayed the way it was and the code was updated to work as the documentation suggests. I don't have time to write a patch at the moment tho.
I think it's a bad idea to close tickets that are known problems without them being resolved. Even if they are documentation issues. I'd guess there's been some discussion about this somewhere though? Got a link?
-
Pratik July 17th, 2008 @ 12:40 AM
Please continue the discussion in rails-core mailing list. If there is an agreement there, I'll re-open.
Thanks.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>