oroinc / customer-portal

OroCommerce package with customer portal and non authenticated visitor website base features.
Other
12 stars 15 forks source link

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

Open stiteca opened 3 years ago

stiteca commented 3 years ago

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.

mbessolov commented 3 years ago

Thank you for problem report and the suggested fix!

(internal ID: BB-20199)