add tricky foreign key