Joshua Muheim
2006-Nov-28 08:33 UTC
remove_index appends suffix "_index" to the given name!
Hi all This creates an index with the name position_and_produkt_id_uniq: add_index :bilder, [:produkt_id, :position], :unique => true, :name => :position_and_produkt_id_uniq This should remove the same one: remove_index :bilder, :position_and_produkt_id_uniq Sadly I get the following error: Mysql::Error: Can''t DROP ''bilder_position_and_produkt_id_uniq_index''; check that column/key exists: DROP INDEX `bilder_position_and_produkt_id_uniq_index` ON bilder Why does Rails append the suffix _index to the given name?? And how can I prevent it? Thanks, Josh -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Alain Ravet
2006-Nov-28 08:40 UTC
Re: remove_index appends suffix "_index" to the given name!
Josh, > This creates an index with the name position_and_produkt_id_uniq: > add_index :bilder, ...:name => :position_and_produkt_id_uniq > This should remove the same one: > remove_index :bilder, :position_and_produkt_id_uniq You forgot the '':name => '' part : remove_index :bilder, :name => ''position_and_produkt_id_uniq'' Alain --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Joshua Muheim
2006-Nov-28 08:45 UTC
Re: remove_index appends suffix "_index" to the given name!
Ah, thank you. Anyway, do I need to remove this index explicitly? def self.down remove_index :bilder, :name => :position_and_produkt_id_uniq remove_column :bilder, :position end Because (at least with MySQL) it is destroyed automatically because one of its corresponding fields (position) is deleted... -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Alain Ravet
2006-Nov-28 08:49 UTC
Re: remove_index appends suffix "_index" to the given name!
Joshua > Anyway, do I need to remove this index explicitly? It doesn''t hurt. > Because (at least with MySQL) it is destroyed automatically because one > of its corresponding fields (position) is deleted... As I don''t know how other DB managers work (today), or could work in the future, I wouldn''t take that risk. Alain --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Apparently Analagous Threads
- remove_index missed quote_table_name
- recycle: ... returned No such file or directory
- Moving fileserver
- --partial does not "unhide" the files
- 2x Samba4 Bugs - "mount error(5): Input/output error" & "recycle: stat for ... AFP_AfpInfo returned No such file or directory"