-
Notifications
You must be signed in to change notification settings - Fork 349
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BAP-14388: Add complex index to data audit table (#9103)
- Loading branch information
1 parent
4730cbf
commit 3ca299d
Showing
3 changed files
with
25 additions
and
2 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
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
21 changes: 21 additions & 0 deletions
21
src/Oro/Bundle/DataAuditBundle/Migrations/Schema/v2_0_1/AddIndexToDataAudit.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,21 @@ | ||
<?php | ||
|
||
namespace Oro\Bundle\DataAuditBundle\Migrations\Schema\v2_0_1; | ||
|
||
use Doctrine\DBAL\Schema\Schema; | ||
use Oro\Bundle\MigrationBundle\Migration\Migration; | ||
use Oro\Bundle\MigrationBundle\Migration\QueryBag; | ||
|
||
class AddIndexToDataAudit implements Migration | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function up(Schema $schema, QueryBag $queries) | ||
{ | ||
$table = $schema->getTable('oro_audit'); | ||
if (!$table->hasIndex('idx_oro_audit_obj_by_type')) { | ||
$table->addIndex(['object_id', 'object_class', 'type'], 'idx_oro_audit_obj_by_type', []); | ||
} | ||
} | ||
} |