From d543090db2d38b6d9cae10dc8bbab8abb0d0adf8 Mon Sep 17 00:00:00 2001 From: Hotlander Date: Wed, 3 Jun 2020 13:41:57 +0200 Subject: [PATCH] - dropped unique index on integration ID on SalesChannel to allow a SalesChannelGroup 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 --- .../SalesBundle/Entity/SalesChannel.php | 2 +- .../Schema/MarelloSalesBundleInstaller.php | 3 +- .../Schema/v1_3/MarelloSalesBundle.php | 35 +++++++++++++++++++ 3 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 src/Marello/Bundle/SalesBundle/Migrations/Schema/v1_3/MarelloSalesBundle.php diff --git a/src/Marello/Bundle/SalesBundle/Entity/SalesChannel.php b/src/Marello/Bundle/SalesBundle/Entity/SalesChannel.php index 51294f5dc..e8e10c9ac 100644 --- a/src/Marello/Bundle/SalesBundle/Entity/SalesChannel.php +++ b/src/Marello/Bundle/SalesBundle/Entity/SalesChannel.php @@ -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; diff --git a/src/Marello/Bundle/SalesBundle/Migrations/Schema/MarelloSalesBundleInstaller.php b/src/Marello/Bundle/SalesBundle/Migrations/Schema/MarelloSalesBundleInstaller.php index 359036121..4edbc9d0c 100644 --- a/src/Marello/Bundle/SalesBundle/Migrations/Schema/MarelloSalesBundleInstaller.php +++ b/src/Marello/Bundle/SalesBundle/Migrations/Schema/MarelloSalesBundleInstaller.php @@ -17,7 +17,7 @@ class MarelloSalesBundleInstaller implements Installation */ public function getMigrationVersion() { - return 'v1_2'; + return 'v1_3'; } /** @@ -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', []); } diff --git a/src/Marello/Bundle/SalesBundle/Migrations/Schema/v1_3/MarelloSalesBundle.php b/src/Marello/Bundle/SalesBundle/Migrations/Schema/v1_3/MarelloSalesBundle.php new file mode 100644 index 000000000..f668a56ef --- /dev/null +++ b/src/Marello/Bundle/SalesBundle/Migrations/Schema/v1_3/MarelloSalesBundle.php @@ -0,0 +1,35 @@ +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'); + } + } + +}