Add missing foreign keys

And upgrade foreigner