Initial commit: CloudOps infrastructure platform
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Mautic\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Mautic\CoreBundle\Doctrine\AbstractMauticMigration;
|
||||
|
||||
final class Version20230311195347 extends AbstractMauticMigration
|
||||
{
|
||||
public const BATCH_SIZE = 1000;
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$tableName = MAUTIC_TABLE_PREFIX.'integration_entity';
|
||||
$columnName = 'integration';
|
||||
$value = 'Pipedrive';
|
||||
|
||||
$connection = $this->connection;
|
||||
$rowCount = self::BATCH_SIZE;
|
||||
|
||||
while ($rowCount) {
|
||||
$sql = "DELETE FROM $tableName WHERE $columnName = :value LIMIT ".self::BATCH_SIZE;
|
||||
$rowCount = $connection->executeStatement($sql, ['value' => $value]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user