500 FK error when deleting old image in compute resource
|Assigned To:||Joseph Magen|
|Target version:||Sprint 25|
|Found in release:||Pull request:|
|Velocity based estimate||-|
After a compute resource is edited, or for some reason it no longer has an image, if Foreman had any images in the Compute Resource, deleting them will be impossible through the UI and will throw a 500 error.
Warning! Mysql2::Error: Cannot delete or update a parent row: a foreign key constraint fails (`foreman`.`hosts`, CONSTRAINT `hosts_image_id_fk` FOREIGN KEY (`image_id`) REFERENCES `images` (`id`)): DELETE FROM `images` WHERE `images`.`id` = 3