updateSchema example

return $this->driverConnection->delete($this->configuration['table_name']['id' => $id]) > 0;
        } catch (DBALException $exception) {
            throw new TransportException($exception->getMessage(), 0, $exception);
        }
    }

    public function setup(): void
    {
        $configuration = $this->driverConnection->getConfiguration();
        $assetFilter = $configuration->getSchemaAssetsFilter();
        $configuration->setSchemaAssetsFilter(static fn () => true);
        $this->updateSchema();
        $configuration->setSchemaAssetsFilter($assetFilter);
        $this->autoSetup = false;
    }

    public function getMessageCount(): int
    {
        $queryBuilder = $this->createAvailableMessagesQueryBuilder()
            ->select('COUNT(m.id) AS message_count')
            ->setMaxResults(1);

        $stmt = $this->executeQuery($queryBuilder->getSQL()$queryBuilder->getParameters()$queryBuilder->getParameterTypes());

        

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

    public function update(Connection $connection): void
    {
        $this->updateSchema($connection);
        $this->createUpdateTrigger($connection);
        $this->createInsertTrigger($connection);
        $this->migrateData($connection);
    }

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

    public function updateSchema(Connection $connection): void
    {

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

    public function update(Connection $connection): void
    {
        $this->updateSchema($connection, 'cms_section');
        $this->updateSchema($connection, 'cms_block');
    }

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

    private function updateSchema(Connection $connection, string $tableName): void
    {
        if (!$this->columnExists($connection$tableName, 'visibility')) {
            $connection->executeStatement(\sprintf('ALTER TABLE `%s` ADD COLUMN `visibility` JSON NULL AFTER `background_media_mode`', $tableName));
        }

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

    public function update(Connection $connection): void
    {
        $this->updateSchema($connection);
        $this->createCurrencyUpdateTrigger($connection);
        $this->createCurrencyInsertTrigger($connection);
        $this->createOrderInsertTrigger($connection);
        $this->migrateData($connection);
    }

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

    
Home | Imprint | This part of the site doesn't use cookies.