Caught unhandled error "SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`databaseSql`.`#sql-16c3d_3eb`, CONSTRAINT `mt_image_foreign_product_id_64022a2c8b585` FOREIGN KEY (`product_id`) REFERENCES `mt_product` (`id`) ON DELETE CASCADE ON UPDATE CASCADE)" while building "Cycle\ORM\SchemaInterface".

 

select * from mt_image where product_id not in (select id from mt_product)

delete these records product id not in table product