-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add index on order_transaction_id
- Loading branch information
Christian Ratz
committed
Mar 5, 2024
1 parent
b283616
commit fe7a1eb
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
src/Migration/Migration1709633086AddOrderTransactionIdIndex.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,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace PayonePayment\Migration; | ||
|
||
use Doctrine\DBAL\Connection; | ||
use Shopware\Core\Framework\Migration\MigrationStep; | ||
|
||
class Migration1709633086AddOrderTransactionIdIndex extends MigrationStep | ||
{ | ||
public function getCreationTimestamp(): int | ||
{ | ||
return 1_709_633_086; | ||
} | ||
|
||
public function update(Connection $connection): void | ||
{ | ||
// add index for order-transaction-id | ||
$sql = 'ALTER TABLE `payone_payment_order_transaction_data` ADD INDEX(`order_transaction_id`);'; | ||
|
||
$connection->executeStatement($sql); | ||
} | ||
|
||
public function updateDestructive(Connection $connection): void | ||
{ | ||
// drop index for order-transaction-id | ||
$sql = 'ALTER TABLE `payone_payment_order_transaction_data` DROP INDEX `order_transaction_id`;'; | ||
|
||
$connection->executeStatement($sql); | ||
} | ||
} |