Make sure type of the foreign key match the primary key

See https://github.com/strongloop/loopback/issues/353