Fix foreign key type for has-many associations, retrofits 71068a1

Current stable version forces you to use keyType option on hasMany associations if you want to associate models with a primary key other than INTEGER.

This has already been changed in master and 2.x.x-dev, this commit brings the newer fix into the stable source.