protected function performDbUpdates(array $sqlStatements)
    {
        /** @var ConnectionPool $connectionPool */
        $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
        $schemaMigrator = GeneralUtility::makeInstance(SchemaMigrator::class);

        $sqlUpdateSuggestions = $schemaMigrator->getUpdateSuggestions($sqlStatements);
        $hasErrors = false;

        foreach ($sqlUpdateSuggestions as $connectionName => $updateConnection) {
            $connection = $connectionPool->getConnectionByName($connectionName);
            foreach ($updateConnection as $updateStatements) {
                foreach ($updateStatements as $statement) {
                    try {
                        $connection->exec($statement);
                    } catch (DBALException $exception) {
                        $hasErrors = true;
                        GeneralUtility::devlog(
                            'SQL error',
                            'mask',
                            0,
                            [
                                'statement' => $statement,
                                'error' => $exception->getMessage()
                            ]);
                    }
                }
            }
        }

        if ($hasErrors) {
            return [
                'error' => 'Database could not be updated. Please check it in the update wizard of the install tool'
            ];
        }

        return ['success' => 'Database was successfully updated'];
    }
protected function performDbUpdates(array $sqlStatements)
    {
        /** @var ConnectionPool $connectionPool */
        $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
        $schemaMigrator = GeneralUtility::makeInstance(SchemaMigrator::class);

        $sqlUpdateSuggestions = $schemaMigrator->getUpdateSuggestions($sqlStatements);
        $hasErrors = false;

        foreach ($sqlUpdateSuggestions as $connectionName => $updateConnection) {
            $connection = $connectionPool->getConnectionByName($connectionName);
            foreach ($updateConnection as $updateStatements) {
                foreach ($updateStatements as $statement) {
                    try {
                        $connection->exec($statement);
                    } catch (DBALException $exception) {
                        $hasErrors = true;
                        GeneralUtility::devlog(
                            'SQL error',
                            'mask',
                            0,
                            [
                                'statement' => $statement,
                                'error' => $exception->getMessage()
                            ]);
                    }
                }
            }
        }

        if ($hasErrors) {
            return [
                'error' => 'Database could not be updated. Please check it in the update wizard of the install tool'
            ];
        }

        return ['success' => 'Database was successfully updated'];
    }
protected function performDbUpdates ( array $ sqlStatements ) { /** @var ConnectionPool $connectionPool */ $ connectionPool = GeneralUtility :: makeInstance ( ConnectionPool :: class ) ; $ schemaMigrator = GeneralUtility :: makeInstance ( SchemaMigrator :: class ) ; $ sqlUpdateSuggestions = $ schemaMigrator -> getUpdateSuggestions ( $ sqlStatements ) ; $ hasErrors = false ; foreach ( $ sqlUpdateSuggestions as $ connectionName => $ updateConnection ) { $ connection = $ connectionPool -> getConnectionByName ( $ connectionName ) ; foreach ( $ updateConnection as $ updateStatements ) { foreach ( $ updateStatements as $ statement ) { try { $ connection -> exec ( $ statement ) ; } catch ( DBALException $ exception ) { $ hasErrors = true ; GeneralUtility :: devlog ( 'SQL error' , 'mask' , 0 , [ 'statement' => $ statement , 'error' => $ exception -> getMessage ( ) ] ) ; } } } } if ( $ hasErrors ) { return [ 'error' => 'Database could not be updated. Please check it in the update wizard of the install tool' ] ; } return [ 'success' => 'Database was successfully updated' ] ; }
Performs updates, adjusted function from extension_builder

@param array $params
@param string[] $sql
@return array
@throws DBALException
@throws \Doctrine\DBAL\Schema\SchemaException
@throws \TYPO3\CMS\Core\Database\Schema\Exception\StatementException
@throws \TYPO3\CMS\Core\Database\Schema\Exception\UnexpectedSignalReturnValueTypeException
@throws \TYPO3\CMS\Extbase\SignalSlot\Exception\InvalidSlotException
@throws \TYPO3\CMS\Extbase\SignalSlot\Exception\InvalidSlotReturnException
Performs updates adjusted function from extension_builder