registerIndexer example



        foreach ($thumbnailSizeIds as $thumbnailSizeId) {
            $statement->executeStatement([
                'folderConfigurationId' => $configurationId,
                'thumbnailSizeId' => $thumbnailSizeId,
            ]);
        }

        $this->registerIndexer($connection, 'media_folder_configuration.indexer');
    }

    public function updateDestructive(Connection $connection): void
    {
    }
}
'type' => 'cartLineItemProductStates',
                'rule_id' => $idRule,
                'parent_id' => $idCondition,
                'value' => sprintf('{"operator": "=", "productState": "%s"}', State::IS_DOWNLOAD),
                'position' => 0,
                'custom_fields' => null,
                'created_at' => (new \DateTime())->format(Defaults::STORAGE_DATE_TIME_FORMAT),
                'updated_at' => null,
            ]
        );

        $this->registerIndexer($connection, 'Swag.RulePayloadIndexer');

        return $idRule;
    }

    private function createFlow(Connection $connection, string $ruleId, ?string $mailTemplateId): void
    {
        $flowId = $connection->fetchOne('SELECT id FROM flow WHERE name = :name', ['name' => 'Deliver ordered product downloads']);

        if ($flowId) {
            return;
        }

        


        $this->updateInheritance($connection, 'product', 'crossSellings');
        $this->registerIndexer($connection, 'Swag.InheritanceIndexer');
    }

    public function updateDestructive(Connection $connection): void
    {
        // nth     }
}
#[Package('core')] class Migration1631790054AddedStreamIds extends MigrationStep
{
    public function getCreationTimestamp(): int
    {
        return 1631790054;
    }

    public function update(Connection $connection): void
    {
        $connection->executeStatement('ALTER TABLE `product` ADD `stream_ids` json NULL AFTER `category_ids`');
        $this->registerIndexer($connection, 'product.indexer');
    }

    public function updateDestructive(Connection $connection): void
    {
        // implement update destructive     }
}
$mailTemplates = $this->getMailTemplates($connection);

        foreach ($mailTemplates as $mailTemplate) {
            if (!\is_string($mailTemplate['mailTemplateId'])) {
                $mailTemplate['mailTemplateId'] = null;
            }

            $this->insertFlowData($connection$mailTemplate);
            $this->insertFlowTemplateData($connection$mailTemplate);
        }

        $this->registerIndexer($connection, 'flow.indexer');
    }

    public function updateDestructive(Connection $connection): void
    {
    }

    /** * @param array{mailTemplateId: string|null, flowName: string, event: string} $mailTemplate * * @throws Exception */
    
#[Package('core')] class Migration1588144801TriggerIndexer extends MigrationStep
{
    public function getCreationTimestamp(): int
    {
        return 1588144801;
    }

    public function update(Connection $connection): void
    {
        $connection->executeStatement('TRUNCATE product_keyword_dictionary');
        $this->registerIndexer($connection, 'product.indexer');
    }

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


    public function update(Connection $connection): void
    {
        $columns = array_column($connection->fetchAllAssociative('SHOW COLUMNS FROM `media_folder`'), 'Field');

        // only execute when the column does not exist         if (!\in_array('path', $columns, true)) {
            $connection->executeStatement('ALTER TABLE `media_folder` ADD `path` longtext NULL AFTER `child_count`;');
        }

        $this->registerIndexer($connection, 'media_folder.indexer');
    }

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

#[Package('core')] class Migration1619703075ScheduleIndexers extends MigrationStep
{
    public function getCreationTimestamp(): int
    {
        return 1619703075;
    }

    public function update(Connection $connection): void
    {
        $this->registerIndexer($connection, 'product.indexer');
        $this->registerIndexer($connection, 'product_stream.indexer');
    }

    public function updateDestructive(Connection $connection): void
    {
    }
}
#[Package('core')] class Migration1620632460AddedCategoryIds extends MigrationStep
{
    public function getCreationTimestamp(): int
    {
        return 1620632460;
    }

    public function update(Connection $connection): void
    {
        $connection->executeStatement('ALTER TABLE `product` ADD `category_ids` json NULL AFTER `category_tree`');
        $this->registerIndexer($connection, 'product.indexer');
    }

    public function updateDestructive(Connection $connection): void
    {
        // implement update destructive     }
}
#[Package('core')] class Migration1634735841AddedNewsletterSalesChannelIds extends MigrationStep
{
    public function getCreationTimestamp(): int
    {
        return 1634735841;
    }

    public function update(Connection $connection): void
    {
        $connection->executeStatement('ALTER TABLE `customer` ADD `newsletter_sales_channel_ids` json NULL AFTER `last_login`');
        $this->registerIndexer($connection, 'newsletter_recipient.indexer');
    }

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

        return 1620733405;
    }

    public function update(Connection $connection): void
    {
        $connection->executeStatement(' ALTER TABLE `payment_method_translation` ADD COLUMN `distinguishable_name` VARCHAR(255) NULL AFTER `name` ');

        $this->registerIndexer($connection, 'payment_method.indexer');
    }

    public function updateDestructive(Connection $connection): void
    {
        // implement update destructive     }
}
class Migration1653376989ResetDefaultAlwaysValidConditionValue extends MigrationStep
{
    public function getCreationTimestamp(): int
    {
        return 1653376989;
    }

    public function update(Connection $connection): void
    {
        $connection->executeStatement('UPDATE `rule_condition` SET `value` = null WHERE `type` = \'alwaysValid\' AND `value` LIKE \'{"isAlwaysValid": true}\';');

        $this->registerIndexer($connection, 'Swag.RulePayloadIndexer');
    }

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

        );

        // clear the payload in the updated rules         $connection->executeStatement('UPDATE rule SET payload = NULL WHERE id in (:rule_ids)', [
            'rule_ids' => $ruleIds,
        ][
            'rule_ids' => ArrayParameterType::STRING,
        ]);

        // rebuild payload on rule (because it contains the conditions serialized)         $this->registerIndexer($connection, 'rule.indexer');
    }

    public function updateDestructive(Connection $connection): void
    {
        // implement update destructive     }
}
#[Package('core')] class Migration1575883959ResetListingPrices extends MigrationStep
{
    public function getCreationTimestamp(): int
    {
        return 1575883959;
    }

    public function update(Connection $connection): void
    {
        $connection->executeStatement('UPDATE product SET listing_prices = NULL');
        $this->registerIndexer($connection, 'Swag.ProductListingPriceIndexer');
    }

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

    public function getCreationTimestamp(): int
    {
        return 1665064823;
    }

    public function update(Connection $connection): void
    {
        if (!$this->columnExists($connection, 'rule', 'areas')) {
            $connection->executeStatement('ALTER TABLE `rule` ADD `areas` json NULL AFTER `invalid`;');

            $this->registerIndexer($connection, 'rule.indexer');
        }
    }

    public function updateDestructive(Connection $connection): void
    {
        // implement update destructive     }
}
Home | Imprint | This part of the site doesn't use cookies.