When trying to process a rename_column database migration, I ran into the following error after running rake db:migrate:
Index name 'temp_index_altered_long_class_name_on_even_longer_class_name_id' on table 'altered_long_class_name' is too long; the limit is 64 characters
This is an issue with index name length when using sqlite. A simple fix is to remove the index prior to renaming the column, then add it back in afterwards, as follows:
remove_index :long_class_name, [:even_longer_class_name_id]
rename_column :long_class_name, :original_name, :new_name
add_index :long_class_name, [:even_longer_class_name_id], :name => "index_long_class_name_on_even_longer_class_name_id"
I’ve started playing with Jens Alfke’s MYNetwork library for an upcoming project, but I was getting some compile errors straight off the bat. Most were solved by actually RTFM, but the last required a bit of minor surgery.
MYNetwork depends on MYUtilities, which in turn includes a subset of GoogleToolbox. One of the files from GoogleToolbox was throwing the following error when I built targeting Leopard:
warning: 'stringWithCString:' is deprecated
This warning is upgraded to a full-blown error when trying to compile against Snow Leopard.
To fix this error, replace the file MYUtilities/GoogleToolboxSubset/GTMDefines.h with the newest version of the same file from the GoogleToolbox Google Code repository. This file contains updated method definitions which take account of certain method deprecations in OS X 10.5 and 10.6, including our little friend stringWithCString:.