Cannot delete or update a parent row: a foreign key constraint fails (`promobricodeco2021`.`purchase`, CONSTRAINT `FK_6117D13B44AC3583` FOREIGN KEY (`operation_id`) REFERENCES `operation` (`id`)) code example
Example: Cannot delete or update a parent row: a foreign key constraint fails (
ALTER TABLE "appointments" DROP FOREIGN KEY "appointments_user_id_foreign";
ALTER TABLE "appointments" ADD CONSTRAINT "appointments_user_id_foreign" FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON DELETE CASCADE;