-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- split the SalesBundle migrations as v1_3 was already released...
- Loading branch information
Showing
2 changed files
with
48 additions
and
1 deletion.
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
47 changes: 47 additions & 0 deletions
47
src/Marello/Bundle/SalesBundle/Migrations/Schema/v1_3_1/MarelloSalesBundle.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,47 @@ | ||
<?php | ||
|
||
namespace Marello\Bundle\SalesBundle\Migrations\Schema\v1_3_1; | ||
|
||
use Doctrine\DBAL\Schema\Schema; | ||
use Oro\Bundle\MigrationBundle\Migration\Migration; | ||
use Oro\Bundle\MigrationBundle\Migration\QueryBag; | ||
|
||
/** | ||
* @SuppressWarnings(PHPMD.TooManyMethods) | ||
* @SuppressWarnings(PHPMD.ExcessiveClassLength) | ||
*/ | ||
class MarelloSalesBundle implements Migration | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function up(Schema $schema, QueryBag $queries) | ||
{ | ||
/** Tables generation **/ | ||
$this->modifyMarelloSalesSalesChannelGroupTable($schema); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected function modifyMarelloSalesSalesChannelGroupTable(Schema $schema) | ||
{ | ||
$table = $schema->getTable('marello_sales_channel_group'); | ||
if (!$table->hasColumn('integration_channel_id')) { | ||
$table->addColumn('integration_channel_id', 'integer', ['notnull' => false]); | ||
} | ||
|
||
if (!$table->hasIndex('UNIQ_759DCFAB3D6A9E29')) { | ||
$table->addUniqueIndex(['integration_channel_id'], 'UNIQ_759DCFAB3D6A9E29'); | ||
} | ||
|
||
if ($table->hasForeignKey('FK_759DCFAB3D6A9E29')) { | ||
$table->addForeignKeyConstraint( | ||
$schema->getTable('oro_integration_channel'), | ||
['integration_channel_id'], | ||
['id'], | ||
['onDelete' => 'SET NULL', 'onUpdate' => null] | ||
); | ||
} | ||
} | ||
} |