diff --git a/src/Oro/Bundle/CommerceMenuBundle/Migrations/Schema/OroCommerceMenuBundleInstaller.php b/src/Oro/Bundle/CommerceMenuBundle/Migrations/Schema/OroCommerceMenuBundleInstaller.php index 0da178377..61aaab4e5 100644 --- a/src/Oro/Bundle/CommerceMenuBundle/Migrations/Schema/OroCommerceMenuBundleInstaller.php +++ b/src/Oro/Bundle/CommerceMenuBundle/Migrations/Schema/OroCommerceMenuBundleInstaller.php @@ -29,7 +29,7 @@ class OroCommerceMenuBundleInstaller implements */ public function getMigrationVersion() { - return 'v1_7'; + return 'v1_8'; } /** @@ -188,7 +188,8 @@ protected function addOroCommerceMenuUpdateForeignKeys(Schema $schema) $table->addForeignKeyConstraint( $schema->getTable('oro_scope'), ['scope_id'], - ['id'] + ['id'], + ['onUpdate' => null, 'onDelete' => 'CASCADE'] ); $table->addForeignKeyConstraint( $schema->getTable('oro_web_catalog_content_node'), diff --git a/src/Oro/Bundle/CommerceMenuBundle/Migrations/Schema/v1_8/AddScopeToMenuUpdateTable.php b/src/Oro/Bundle/CommerceMenuBundle/Migrations/Schema/v1_8/AddScopeToMenuUpdateTable.php new file mode 100644 index 000000000..1749674b8 --- /dev/null +++ b/src/Oro/Bundle/CommerceMenuBundle/Migrations/Schema/v1_8/AddScopeToMenuUpdateTable.php @@ -0,0 +1,36 @@ +addOroCommerceMenuUpdateForeignKeys($schema); + } + + /** + * Add oro_commerce_menu_upd foreign keys. + * + * @param Schema $schema + */ + protected function addOroCommerceMenuUpdateForeignKeys(Schema $schema) + { + $table = $schema->getTable('oro_commerce_menu_upd'); + $table->addForeignKeyConstraint( + $schema->getTable('oro_scope'), + ['scope_id'], + ['id'], + ['onUpdate' => null, 'onDelete' => 'CASCADE'] + ); + } +}