Make sure type of the foreign key match the primary key

/to @ritch 

See https://github.com/strongloop/loopback/issues/353