I came across a problem while trying to run unit tests for the depot application, caused by the failure to migrate my database into test environment.
If anyone is having the same issue, it seems that there is a problem with the MySQL adapter, in ActiveRecord, for the 2.1 Rails release.
The problem is that it fails to detect correctly the data type, we are referring, and when it tries to migrate MySQL won’t allow for foreign keys referring different data types.
There are more details and a patch to quick fix-it here: http://blog.smartlogicsolutions.com/2008/06/24/rails-21-broke-my-mysql-foreign-keys/
Applying the patch to my adapter solved the issue.