Skip to content

Commit

Permalink
- split the SalesBundle migrations as v1_3 was already released...
Browse files Browse the repository at this point in the history
  • Loading branch information
24198 committed Jul 9, 2020
1 parent 36e9e92 commit 8b9df75
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class MarelloSalesBundleInstaller implements Installation
*/
public function getMigrationVersion()
{
return 'v1_3';
return 'v1_3_1';
}

/**
Expand Down
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]
);
}
}
}

0 comments on commit 8b9df75

Please sign in to comment.