-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'remotes/origin/master' into 1.5
- Loading branch information
Showing
7 changed files
with
569 additions
and
4 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
58 changes: 58 additions & 0 deletions
58
src/OroCRM/Bundle/AccountBundle/Migrations/Schema/v1_7/DropExtendConfigQuery.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,58 @@ | ||
<?php | ||
|
||
namespace OroCRM\Bundle\AccountBundle\Migrations\Schema\v1_7; | ||
|
||
use Psr\Log\LoggerInterface; | ||
|
||
use Oro\Bundle\MigrationBundle\Migration\ArrayLogger; | ||
use Oro\Bundle\MigrationBundle\Migration\ParametrizedMigrationQuery; | ||
|
||
class DropExtendConfigQuery extends ParametrizedMigrationQuery | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getDescription() | ||
{ | ||
$logger = new ArrayLogger(); | ||
$logger->info('Drop extend config values'); | ||
$this->doExecute($logger, true); | ||
|
||
return $logger->getMessages(); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function execute(LoggerInterface $logger) | ||
{ | ||
$this->doExecute($logger); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function doExecute(LoggerInterface $logger, $dryRun = false) | ||
{ | ||
$updateSql = <<<DQL | ||
DELETE FROM oro_entity_config_field WHERE field_name IN (?, ?, ?, ?, ?, ?, ?) | ||
AND entity_id IN (SELECT id FROM oro_entity_config WHERE class_name = ?); | ||
DQL; | ||
|
||
$params = [ | ||
'extend_website', | ||
'extend_employees', | ||
'extend_ownership', | ||
'extend_ticker_symbol', | ||
'extend_rating', | ||
'shippingAddress', | ||
'billingAddress', | ||
'OroCRM\\Bundle\\AccountBundle\\Entity\\Account', | ||
]; | ||
|
||
$this->logQuery($logger, $updateSql, $params); | ||
if (!$dryRun) { | ||
$this->connection->executeUpdate($updateSql, $params); | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/OroCRM/Bundle/AccountBundle/Migrations/Schema/v1_7/OroCRMSalesBundle.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,19 @@ | ||
<?php | ||
|
||
namespace OroCRM\Bundle\AccountBundle\Migrations\Schema\v1_7; | ||
|
||
use Doctrine\DBAL\Schema\Schema; | ||
|
||
use Oro\Bundle\MigrationBundle\Migration\Migration; | ||
use Oro\Bundle\MigrationBundle\Migration\QueryBag; | ||
|
||
class OroCRMSalesBundle implements Migration | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function up(Schema $schema, QueryBag $queries) | ||
{ | ||
$queries->addPostQuery(new DropExtendConfigQuery()); | ||
} | ||
} |
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
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
Oops, something went wrong.