-
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.
- removed unique index on Customer primary/shipping address as it is …
…a theoretical posibility that they are exactly the same address
- Loading branch information
Showing
2 changed files
with
51 additions
and
3 deletions.
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
50 changes: 50 additions & 0 deletions
50
src/Marello/Bundle/CustomerBundle/Migrations/Schema/v1_4_1/MarelloCustomerBundle.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,50 @@ | ||
<?php | ||
|
||
namespace Marello\Bundle\CustomerBundle\Migrations\Schema\v1_4_1; | ||
|
||
use Doctrine\DBAL\Schema\Schema; | ||
|
||
use Oro\Bundle\MigrationBundle\Migration\Migration; | ||
use Oro\Bundle\MigrationBundle\Migration\QueryBag; | ||
use Oro\Bundle\ActivityBundle\Migration\Extension\ActivityExtension; | ||
use Oro\Bundle\ActivityBundle\Migration\Extension\ActivityExtensionAwareInterface; | ||
|
||
use Marello\Bundle\CustomerBundle\Migrations\Schema\MarelloCustomerBundleInstaller; | ||
|
||
class MarelloCustomerBundle implements Migration | ||
{ | ||
/** | ||
* @inheritDoc | ||
*/ | ||
public function up(Schema $schema, QueryBag $queries) | ||
{ | ||
$table = $schema->getTable(MarelloCustomerBundleInstaller::MARELLO_CUSTOMER_TABLE); | ||
// drop unique indexes for customer primary and shipping address | ||
if ($table->hasIndex('UNIQ_75C456C9F5B7AF75')) { | ||
$table->dropIndex('UNIQ_75C456C9F5B7AF75'); | ||
} | ||
|
||
if ($table->hasIndex('UNIQ_75C456C94D4CFF2B')) { | ||
$table->dropIndex('UNIQ_75C456C94D4CFF2B'); | ||
} | ||
|
||
if ($table->hasForeignKey('FK_AD0CE5A24D4CFF2B')) { | ||
$table->removeForeignKey('FK_AD0CE5A24D4CFF2B'); | ||
$table->addForeignKeyConstraint( | ||
$schema->getTable('marello_address'), | ||
['shipping_address_id'], | ||
['id'], | ||
['onDelete' => null, 'onUpdate' => null] | ||
); | ||
} | ||
if ($table->hasForeignKey('FK_AD0CE5A2CB134313')) { | ||
$table->removeForeignKey('FK_AD0CE5A2CB134313'); | ||
$table->addForeignKeyConstraint( | ||
$schema->getTable('marello_address'), | ||
['primary_address_id'], | ||
['id'], | ||
['onDelete' => null, 'onUpdate' => null] | ||
); | ||
} | ||
} | ||
} |