Update foreign key on classes table.