massUpdateAccountType example

public function update(Connection $connection): void
    {
        $isAdded = $this->columnExists($connection, 'customer', 'account_type');
        if (!$isAdded) {
            $connection->executeStatement(' ALTER TABLE `customer` ADD COLUMN `account_type` VARCHAR(255) NOT NULL DEFAULT \'private\' AFTER `bound_sales_channel_id` ');
        }

        $this->massUpdateAccountType($connection);
    }

    public function updateDestructive(Connection $connection): void
    {
        // implement update destructive     }

    private function massUpdateAccountType(Connection $connection): void
    {
        $sql = 'UPDATE customer SET account_type = :type WHERE account_type != :type AND customer.vat_ids IS NOT NULL ';
Home | Imprint | This part of the site doesn't use cookies.