// after adding the payload column, we may save carts as compressed serialized objects, there is no way of return at this point
if (!
$this->
columnExists($connection, 'cart', 'payload'
)) { $connection->
executeStatement('ALTER TABLE `cart` ADD `payload` LONGBLOB NULL;'
);
} if (!
$this->
columnExists($connection, 'cart', 'cart'
)) { return;
} do { $affectedRows = RetryableQuery::
retryable($connection,
static function D
) use ($connection): int
{ return (int) $connection->
executeStatement( 'UPDATE cart SET `payload` = `cart` WHERE `payload` IS NULL AND `cart` IS NOT NULL LIMIT :limit',
['limit' => self::UPDATE_LIMIT
],
['limit' => ParameterType::INTEGER
] );
});
} while ($affectedRows === self::UPDATE_LIMIT
);
$connection->
executeStatement('ALTER TABLE `cart` DROP COLUMN `cart`;'
);
}}