Add migration to add foreign key affinitic refs #5522