1038350- Fixed a CV foreign key migration issue

Handled the case where changeset was associated with a CV
and then changeset deleted. Upgrade causes FK violation.