-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add state resent * chore: prepare release 3.3.0
- Loading branch information
Showing
8 changed files
with
52 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
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,38 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Frosh\MailArchive\Migration; | ||
|
||
use Doctrine\DBAL\ArrayParameterType; | ||
use Doctrine\DBAL\Connection; | ||
use Shopware\Core\Framework\Migration\MigrationStep; | ||
|
||
class Migration1739273849MigrateResentState extends MigrationStep | ||
{ | ||
public function getCreationTimestamp(): int | ||
{ | ||
return 1739273849; | ||
} | ||
|
||
public function update(Connection $connection): void | ||
{ | ||
$sourceMailIds = $connection->fetchFirstColumn('SELECT source_mail_id FROM frosh_mail_archive WHERE source_mail_id IS NOT NULL GROUP BY source_mail_id;'); | ||
|
||
if (empty($sourceMailIds)) { | ||
return; | ||
} | ||
|
||
$updateQuery = $connection->createQueryBuilder(); | ||
$updateQuery->update('frosh_mail_archive'); | ||
$updateQuery->set('transport_state', '\'resent\''); | ||
$updateQuery->where('id IN (:ids)'); | ||
|
||
foreach (array_chunk($sourceMailIds, 1000) as $chunk) { | ||
$updateQuery->setParameter('ids', $chunk, ArrayParameterType::BINARY); | ||
$updateQuery->executeStatement(); | ||
} | ||
} | ||
|
||
public function updateDestructive(Connection $connection): void {} | ||
} |
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
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
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