Skip to content
New issue

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

add onDelete cascade on foreign key constraint between MenuUpdate and Scope #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stiteca
Copy link

@stiteca stiteca commented Dec 22, 2020

Hi,

I got an error in version 4.2RC while trying to delete a Website :

  An exception occurred while executing 'DELETE FROM oro_website WHERE id = ?  ' with params [1]:
  SQLSTATE[23503]: Foreign key violation: 7 ERROR:  update or delete on table "oro_scope" violates foreign key constraint "fk_8e13dcb9682b5931" on table  "oro_commerce_menu_upd"
  DETAIL:  Key (id)=(2) is still referenced from table "oro_commerce_menu_upd".

Due to an entry in table oro_commerce_menu_upd (Oro\Bundle\CommerceMenuBundle\Entity\MenuUpdate class) linked to Scope which is linked to the Website.

So I did like the AddScopeToMenuUpdateTable.php file of v1_2 and fixed the adding of foreign key constraint and I fixed the OroCommerceMenuBundleInstaller.php.

Best regards.

@stiteca stiteca force-pushed the fix_MenuUpdate_Scope_constraint branch from 766bb20 to 5253773 Compare December 22, 2020 15:59
@mbessolov
Copy link
Member

Thank you for problem report and the suggested fix!

(internal ID: BB-20199)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

2 participants