Add missing foreign keys when upgrading [rejected]