Fix VARCHAR primary key

Fix problem with VARCHAR primary key on related table