-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add onDelete cascade on foreign key constraint between MenuUpdate and…
… Scope
- Loading branch information
Showing
2 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/Oro/Bundle/CommerceMenuBundle/Migrations/Schema/v1_8/AddScopeToMenuUpdateTable.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace Oro\Bundle\CommerceMenuBundle\Migrations\Schema\v1_8; | ||
|
||
use Doctrine\DBAL\Schema\Schema; | ||
use Oro\Bundle\MigrationBundle\Migration\Migration; | ||
use Oro\Bundle\MigrationBundle\Migration\QueryBag; | ||
|
||
class AddScopeToMenuUpdateTable implements Migration | ||
{ | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function up(Schema $schema, QueryBag $queries) | ||
{ | ||
/** Table updates **/ | ||
$this->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'] | ||
); | ||
} | ||
} |