Adding support for multiple foreignKeys and primaryKeys