Guys -
There is a very simple problem with the add_index command &
mysql. It is not validating whether index names are too long and
working around them.
e.g.:
# Comp Category Hierarchy Table
create_table :comp_category_hierarchies, :id => false do |t|
t.column :comp_category_id, :integer, :null => false
t.column :comp_subcategory_id, :integer, :null => false
end
add_index(:comp_category_hierarchies, [:comp_category_id, :comp_subcategory_id], :unique => true)
Generates the following error:
Mysql::Error: Identifier name 'index_comp_category_hierarchies_on_comp_category_id_and_comp_subcategory_id' is too long: CREATE UNIQUE INDEX `index_comp_category_hierarchies_on_comp_category_id_and_comp_subcategory_id` ON `comp_category_hierarchies` (`comp_category_id`, `comp_subcategory_id`)
Just thought I would let you know.
Thanks for all the hard work.