Skip to content

Commit

Permalink
- dropped unique index on integration ID on SalesChannel to allow a S…
Browse files Browse the repository at this point in the history
…alesChannelGroup with multiple SC's be connected to the integration

- moved some fields around in the integration settings form
- updated the OroCommerce integration event listener to take into account the integration is now linked to a SalesChannelGroup and not a single SalesChannel
  • Loading branch information
24198 committed Jun 3, 2020
1 parent 9f3d6dc commit d543090
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Marello/Bundle/SalesBundle/Entity/SalesChannel.php
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ public function getIntegrationChannel()
* @param Channel $integrationChannel
* @return $this
*/
public function setIntegrationChannel(Channel $integrationChannel)
public function setIntegrationChannel(Channel $integrationChannel = null)
{
$this->integrationChannel = $integrationChannel;

Expand Down
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_2';
return 'v1_3';
}

/**
Expand Down Expand Up @@ -73,7 +73,6 @@ protected function createMarelloSalesSalesChannelTable(Schema $schema)
$table->addColumn('integration_channel_id', 'integer', ['notnull' => false]);
$table->setPrimaryKey(['id']);
$table->addUniqueIndex(['code'], 'marello_sales_sales_channel_codeidx');
$table->addUniqueIndex(['integration_channel_id'], 'UNIQ_75C456C9F5B7AF7511');
$table->addIndex(['owner_id'], 'idx_37c71d17e3c61f9', []);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

namespace Marello\Bundle\SalesBundle\Migrations\Schema\v1_3;

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->modifyMarelloSalesSalesChannelTable($schema);
}

/**
* @param Schema $schema
*/
protected function modifyMarelloSalesSalesChannelTable(Schema $schema)
{
$table = $schema->getTable('marello_sales_sales_channel');
if ($table->hasIndex('UNIQ_75C456C9F5B7AF7511')) {
$table->dropIndex('UNIQ_75C456C9F5B7AF7511');
}
}

}

0 comments on commit d543090

Please sign in to comment.