Makes index usable for non-varchar foreigh keys

If field foreign_key varchar(64) references integer PK none of the indexes can be used (at least in MySQL though). Converting any foreign PK to varchar-compatible type solves the problem