From 7bcd871464bfcd2faecae12f4058dd4ec2f57ff6 Mon Sep 17 00:00:00 2001 From: Alexander Nezdoiminoga Date: Tue, 14 Feb 2017 14:20:21 +0200 Subject: [PATCH] CRM-7627: Update from 1.9.3 to 2.0.1 is broken --- .../SalesBundle/Migrations/Schema/v1_33/UpdateIndexes.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Oro/Bundle/SalesBundle/Migrations/Schema/v1_33/UpdateIndexes.php b/src/Oro/Bundle/SalesBundle/Migrations/Schema/v1_33/UpdateIndexes.php index 55633f8a16a..15fefda2daf 100644 --- a/src/Oro/Bundle/SalesBundle/Migrations/Schema/v1_33/UpdateIndexes.php +++ b/src/Oro/Bundle/SalesBundle/Migrations/Schema/v1_33/UpdateIndexes.php @@ -23,9 +23,11 @@ public function up(Schema $schema, QueryBag $queries) 'budget_amount_value', 'created_at' ]; - if ($table->hasIndex($indexName) && $table->getIndex($indexName)->getColumns() !== $indexColumns) { - $table->dropIndex($indexName); - $table->addIndex($indexColumns, $indexName); + if ($table->hasIndex($indexName)) { + if ($table->getIndex($indexName)->getColumns() !== $indexColumns) { + $table->dropIndex($indexName); + $table->addIndex($indexColumns, $indexName); + } } else { $table->addIndex($indexColumns, $indexName); }