We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i have just inserted one Product into Database and, if i add some images in the product edit screen, the app goes in crash:
I got this error message
SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (scotchbox.product_images, CONSTRAINT product_images_product_id_foreign FOREIGN KEY (product_id) REFERENCES products (id)) (SQL: delete from products where id = 48)
scotchbox
product_images
product_images_product_id_foreign
product_id
products
id
From CreateProductImagesTable i tried to modify this column $table->foreign('product_id')->references('id')->on('products')
to $table->foreign('product_id')->references('id')->on('products')->onDelete('cascade');
After a "php artisan migrate:fresh", the issue should resolve.
Regards
The text was updated successfully, but these errors were encountered:
No branches or pull requests
i have just inserted one Product into Database and, if i add some images in the product edit screen, the app goes in crash:
I got this error message
SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (
scotchbox
.product_images
, CONSTRAINTproduct_images_product_id_foreign
FOREIGN KEY (product_id
) REFERENCESproducts
(id
)) (SQL: delete fromproducts
whereid
= 48)From CreateProductImagesTable i tried to modify this column
$table->foreign('product_id')->references('id')->on('products')
to
$table->foreign('product_id')->references('id')->on('products')->onDelete('cascade');
After a "php artisan migrate:fresh", the issue should resolve.
Regards
The text was updated successfully, but these errors were encountered: