From fcde135b3c838680cba8f4d7c503ddff84e386e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Mu=CC=88ller?= Date: Sun, 23 Jun 2024 13:55:57 +0200 Subject: [PATCH 1/8] TASK: Raise doctrine/dbal version constraint Adjust to changes in DBAL API --- ...ectionIntegrityViolationDetectionTrait.php | 16 +++++++------- .../composer.json | 2 +- .../DoctrineDbalContentGraphSchemaBuilder.php | 5 +++++ .../ProjectionIntegrityViolationDetector.php | 4 ++-- .../src/Domain/Repository/ContentGraph.php | 4 ++-- .../src/Domain/Repository/ContentSubgraph.php | 21 +++++++------------ .../src/Domain/Repository/NodeFactory.php | 5 +++-- .../Projection/Feature/NodeVariation.php | 9 ++++---- .../Projection/ProjectionHypergraph.php | 7 +++---- .../Query/ProjectionHypergraphQuery.php | 2 +- .../ProjectionHypergraphQueryInterface.php | 2 +- .../Query/CommonGraphQueryOperations.php | 10 ++------- .../Query/HypergraphQueryInterface.php | 7 ++++--- .../Infrastructure/DbalCheckpointStorage.php | 12 +++++------ .../Infrastructure/DbalSchemaFactory.php | 7 ++++++- .../Projection/Workspace/WorkspaceFinder.php | 5 +++-- Neos.ContentRepository.Core/composer.json | 2 +- .../Classes/Command/CrCommandController.php | 2 ++ .../Classes/Helpers/AssetExtractor.php | 4 ++-- .../Classes/NodeDataToEventsProcessor.php | 5 ++--- Neos.Media/composer.json | 2 +- .../Projection/AssetUsageRepository.php | 2 +- .../Projection/DocumentUriPathFinder.php | 4 ++-- .../Projection/DocumentUriPathProjection.php | 2 +- .../DocumentUriPathSchemaBuilder.php | 9 ++++++++ .../PendingChangesProjection/ChangeFinder.php | 4 ++-- .../ChangeProjection.php | 15 +++++++------ .../Features/Bootstrap/RoutingTrait.php | 2 +- .../Controller/WorkspaceController.php | 4 ++-- composer.json | 2 +- 30 files changed, 96 insertions(+), 81 deletions(-) diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Bootstrap/ProjectionIntegrityViolationDetectionTrait.php b/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Bootstrap/ProjectionIntegrityViolationDetectionTrait.php index 4e21b0ae39e..006981b11f7 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Bootstrap/ProjectionIntegrityViolationDetectionTrait.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Bootstrap/ProjectionIntegrityViolationDetectionTrait.php @@ -16,7 +16,7 @@ use Behat\Gherkin\Node\TableNode; use Doctrine\DBAL\Connection; -use Doctrine\DBAL\DBALException; +use Doctrine\DBAL\Exception; use Doctrine\DBAL\Exception\InvalidArgumentException; use Neos\ContentGraph\DoctrineDbalAdapter\ContentGraphTableNames; use Neos\ContentGraph\DoctrineDbalAdapter\DoctrineDbalProjectionIntegrityViolationDetectionRunnerFactory; @@ -68,7 +68,7 @@ public function setupDbalGraphAdapterIntegrityViolationTrait() /** * @When /^I remove the following subtree tag:$/ * @param TableNode $payloadTable - * @throws DBALException + * @throws Exception * @throws InvalidArgumentException */ public function iRemoveTheFollowingSubtreeTag(TableNode $payloadTable): void @@ -91,7 +91,7 @@ public function iRemoveTheFollowingSubtreeTag(TableNode $payloadTable): void /** * @When /^I add the following hierarchy relation:$/ - * @throws DBALException + * @throws Exception */ public function iAddTheFollowingHierarchyRelation(TableNode $payloadTable): void { @@ -106,7 +106,7 @@ public function iAddTheFollowingHierarchyRelation(TableNode $payloadTable): void /** * @When /^I change the following hierarchy relation's dimension space point hash:$/ * @param TableNode $payloadTable - * @throws DBALException + * @throws Exception */ public function iChangeTheFollowingHierarchyRelationsDimensionSpacePointHash(TableNode $payloadTable): void { @@ -126,7 +126,7 @@ public function iChangeTheFollowingHierarchyRelationsDimensionSpacePointHash(Tab /** * @When /^I change the following node's name:$/ * @param TableNode $payloadTable - * @throws DBALException + * @throws Exception */ public function iChangeTheFollowingNodesName(TableNode $payloadTable): void { @@ -159,7 +159,7 @@ public function iChangeTheFollowingNodesName(TableNode $payloadTable): void /** * @When /^I set the following position:$/ * @param TableNode $payloadTable - * @throws DBALException + * @throws Exception */ public function iSetTheFollowingPosition(TableNode $payloadTable): void { @@ -183,7 +183,7 @@ public function iSetTheFollowingPosition(TableNode $payloadTable): void /** * @When /^I detach the following reference relation from its source:$/ * @param TableNode $payloadTable - * @throws DBALException + * @throws Exception */ public function iDetachTheFollowingReferenceRelationFromItsSource(TableNode $payloadTable): void { @@ -201,7 +201,7 @@ public function iDetachTheFollowingReferenceRelationFromItsSource(TableNode $pay /** * @When /^I set the following reference position:$/ * @param TableNode $payloadTable - * @throws DBALException + * @throws Exception */ public function iSetTheFollowingReferencePosition(TableNode $payloadTable): void { diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/composer.json b/Neos.ContentGraph.DoctrineDbalAdapter/composer.json index cd728f3777d..a7577a842ed 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/composer.json +++ b/Neos.ContentGraph.DoctrineDbalAdapter/composer.json @@ -13,7 +13,7 @@ }, "require": { "neos/contentrepository-core": "self.version", - "doctrine/dbal": "^2.13", + "doctrine/dbal": "^3.2", "doctrine/migrations": "*" }, "autoload": { diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphSchemaBuilder.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphSchemaBuilder.php index 909bfcc9bdd..1695058e1ec 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphSchemaBuilder.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphSchemaBuilder.php @@ -3,6 +3,7 @@ namespace Neos\ContentGraph\DoctrineDbalAdapter; use Doctrine\DBAL\Exception as DbalException; +use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Schema\AbstractSchemaManager; use Doctrine\DBAL\Schema\Column; use Doctrine\DBAL\Schema\Schema; @@ -23,6 +24,10 @@ public function __construct( ) { } + /** + * @param AbstractSchemaManager $schemaManager + * @return Schema + */ public function buildSchema(AbstractSchemaManager $schemaManager): Schema { return DbalSchemaFactory::createSchemaWithTables($schemaManager, [ diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/ProjectionIntegrityViolationDetector.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/ProjectionIntegrityViolationDetector.php index c7282abb786..74faacefa3f 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/ProjectionIntegrityViolationDetector.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/ProjectionIntegrityViolationDetector.php @@ -55,7 +55,7 @@ public function hierarchyIntegrityIsProvided(): Result try { $disconnectedHierarchyRelationRecords = $this->dbal->executeQuery($disconnectedHierarchyRelationStatement, [ 'rootNodeAnchor' => NodeRelationAnchorPoint::forRootEdge()->value - ]); + ])->fetchAllAssociative(); } catch (DbalException $e) { throw new \RuntimeException(sprintf('Failed to load disconnected hierarchy relations: %s', $e->getMessage()), 1716491735, $e); } @@ -155,7 +155,7 @@ public function siblingsAreDistinctlySorted(): Result FROM {$this->tableNames->node()} WHERE relationanchorpoint = :relationAnchorPoint SQL; - foreach ($ambiguouslySortedHierarchyRelationRecords as $hierarchyRelationRecord) { + foreach ($ambiguouslySortedHierarchyRelationRecords->fetchAllAssociative() as $hierarchyRelationRecord) { try { $ambiguouslySortedNodeRecords = $this->dbal->fetchAllAssociative($ambiguouslySortedNodesStatement, [ 'relationAnchorPoint' => $hierarchyRelationRecord['childnodeanchor'] diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php index b006fa1019d..fbd69c8ab97 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php @@ -344,9 +344,9 @@ private function mapQueryBuilderToNodeAggregate(QueryBuilder $queryBuilder): ?No /** * @param QueryBuilder $queryBuilder - * @return iterable + * @return \Traversable */ - private function mapQueryBuilderToNodeAggregates(QueryBuilder $queryBuilder): iterable + private function mapQueryBuilderToNodeAggregates(QueryBuilder $queryBuilder): \Traversable { return $this->nodeFactory->mapNodeRowsToNodeAggregates( $this->fetchRows($queryBuilder), diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php index 09783f81070..49e0fb5faaf 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php @@ -15,10 +15,9 @@ namespace Neos\ContentGraph\DoctrineDbalAdapter\Domain\Repository; use Doctrine\DBAL\Connection; -use Doctrine\DBAL\Driver\Exception as DbalDriverException; use Doctrine\DBAL\Exception as DbalException; -use Doctrine\DBAL\ForwardCompatibility\Result; use Doctrine\DBAL\Query\QueryBuilder; +use Doctrine\DBAL\Result; use Neos\ContentGraph\DoctrineDbalAdapter\ContentGraphTableNames; use Neos\ContentGraph\DoctrineDbalAdapter\NodeQueryBuilder; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint; @@ -425,7 +424,7 @@ public function countNodes(): int $queryBuilder = $this->nodeQueryBuilder->buildBasicNodeQuery($this->contentStreamId, $this->dimensionSpacePoint, 'n', 'COUNT(*)'); try { $result = $this->executeQuery($queryBuilder)->fetchOne(); - } catch (DbalDriverException | DbalException $e) { + } catch (DbalException $e) { throw new \RuntimeException(sprintf('Failed to count all nodes: %s', $e->getMessage()), 1678364741, $e); } @@ -659,23 +658,19 @@ private function applyPagination(QueryBuilder $queryBuilder, Pagination $paginat /** * @param QueryBuilder $queryBuilder - * @return Result + * @return Result * @throws DbalException */ private function executeQuery(QueryBuilder $queryBuilder): Result { - $result = $queryBuilder->execute(); - if (!$result instanceof Result) { - throw new \RuntimeException(sprintf('Expected instance of %s, got %s', Result::class, get_debug_type($result)), 1678370012); - } - return $result; + return $queryBuilder->executeQuery(); } private function fetchNode(QueryBuilder $queryBuilder): ?Node { try { $nodeRow = $this->executeQuery($queryBuilder)->fetchAssociative(); - } catch (DbalDriverException | DbalException $e) { + } catch (DbalException $e) { throw new \RuntimeException(sprintf('Failed to fetch node: %s', $e->getMessage()), 1678286030, $e); } if ($nodeRow === false) { @@ -694,7 +689,7 @@ private function fetchNodes(QueryBuilder $queryBuilder): Nodes { try { $nodeRows = $this->executeQuery($queryBuilder)->fetchAllAssociative(); - } catch (DbalDriverException | DbalException $e) { + } catch (DbalException $e) { throw new \RuntimeException(sprintf('Failed to fetch nodes: %s', $e->getMessage()), 1678292896, $e); } return $this->nodeFactory->mapNodeRowsToNodes( @@ -710,7 +705,7 @@ private function fetchCount(QueryBuilder $queryBuilder): int { try { return (int)$this->executeQuery($queryBuilder->select('COUNT(*)')->resetQueryPart('orderBy')->setFirstResult(0)->setMaxResults(1))->fetchOne(); - } catch (DbalDriverException | DbalException $e) { + } catch (DbalException $e) { throw new \RuntimeException(sprintf('Failed to fetch count: %s', $e->getMessage()), 1679048349, $e); } } @@ -719,7 +714,7 @@ private function fetchReferences(QueryBuilder $queryBuilder): References { try { $referenceRows = $this->executeQuery($queryBuilder)->fetchAllAssociative(); - } catch (DbalDriverException | DbalException $e) { + } catch (DbalException $e) { throw new \RuntimeException(sprintf('Failed to fetch references: %s', $e->getMessage()), 1678364944, $e); } return $this->nodeFactory->mapReferenceRowsToReferences($referenceRows, $this->workspaceName, $this->contentStreamId, $this->dimensionSpacePoint, $this->visibilityConstraints); diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/NodeFactory.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/NodeFactory.php index 0645bac2c19..bc154fdf80d 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/NodeFactory.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/NodeFactory.php @@ -42,6 +42,7 @@ use Neos\ContentRepository\Core\SharedModel\Node\ReferenceName; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; +use Traversable; /** * Implementation detail of ContentGraph and ContentSubgraph @@ -241,7 +242,7 @@ public function mapNodeRowsToNodeAggregate( /** * @param iterable> $nodeRows - * @return iterable + * @return Traversable * @throws NodeTypeNotFound */ public function mapNodeRowsToNodeAggregates( @@ -249,7 +250,7 @@ public function mapNodeRowsToNodeAggregates( WorkspaceName $workspaceName, ContentStreamId $contentStreamId, VisibilityConstraints $visibilityConstraints - ): iterable { + ): Traversable { $nodeTypeNames = []; $nodeNames = []; $occupiedDimensionSpacePointsByNodeAggregate = []; diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Feature/NodeVariation.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Feature/NodeVariation.php index 4969ab5688a..58bc70dbf37 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Feature/NodeVariation.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Feature/NodeVariation.php @@ -15,6 +15,7 @@ namespace Neos\ContentGraph\PostgreSQLAdapter\Domain\Projection\Feature; use Doctrine\DBAL\Connection; +use Doctrine\DBAL\Exception as DbalException; use Neos\ContentGraph\PostgreSQLAdapter\Domain\Projection\EventCouldNotBeAppliedToContentGraph; use Neos\ContentGraph\PostgreSQLAdapter\Domain\Projection\HierarchyHyperrelationRecord; use Neos\ContentGraph\PostgreSQLAdapter\Domain\Projection\NodeRecord; @@ -197,7 +198,7 @@ private function whenNodePeerVariantWasCreated(NodePeerVariantWasCreated $event) } /** - * @throws \Doctrine\DBAL\DBALException + * @throws DbalException */ protected function copyNodeToOriginDimensionSpacePoint( NodeRecord $sourceNode, @@ -219,7 +220,7 @@ protected function copyNodeToOriginDimensionSpacePoint( } /** - * @throws \Doctrine\DBAL\Exception + * @throws DbalException */ protected function replaceNodeRelationAnchorPoint( ContentStreamId $contentStreamId, @@ -346,7 +347,7 @@ protected function addMissingHierarchyRelations( } /** - * @throws \Doctrine\DBAL\Exception + * @throws DbalException */ protected function assignNewChildNodeToAffectedHierarchyRelations( ContentStreamId $contentStreamId, @@ -371,7 +372,7 @@ protected function assignNewChildNodeToAffectedHierarchyRelations( } /** - * @throws \Doctrine\DBAL\Exception + * @throws DbalException */ protected function assignNewParentNodeToAffectedHierarchyRelations( ContentStreamId $contentStreamId, diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/ProjectionHypergraph.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/ProjectionHypergraph.php index b1c4d0e0f1e..8de46e9ab22 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/ProjectionHypergraph.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/ProjectionHypergraph.php @@ -223,7 +223,7 @@ public function findIngoingHierarchyHyperrelationRecords( } $hierarchyHyperrelations = []; - foreach ($this->dbal->executeQuery($query, $parameters, $types) as $row) { + foreach ($this->dbal->executeQuery($query, $parameters, $types)->fetchAllAssociative() as $row) { $hierarchyHyperrelations[] = HierarchyHyperrelationRecord::fromDatabaseRow($row); } @@ -258,7 +258,7 @@ public function findOutgoingHierarchyHyperrelationRecords( $types['affectedDimensionSpacePointHashes'] = Connection::PARAM_STR_ARRAY; $hierarchyHyperrelations = []; - foreach ($this->dbal->executeQuery($query, $parameters, $types) as $row) { + foreach ($this->dbal->executeQuery($query, $parameters, $types)->fetchAllAssociative() as $row) { $hierarchyHyperrelations[] = HierarchyHyperrelationRecord::fromDatabaseRow($row); } @@ -282,7 +282,7 @@ public function findOutgoingReferenceHyperrelationRecords( ]; $referenceHyperrelations = []; - foreach ($this->dbal->executeQuery($query, $parameters) as $row) { + foreach ($this->dbal->executeQuery($query, $parameters)->fetchAllAssociative() as $row) { $referenceHyperrelations[] = ReferenceRelationRecord::fromDatabaseRow($row); } @@ -290,7 +290,6 @@ public function findOutgoingReferenceHyperrelationRecords( } /** - * @throws \Doctrine\DBAL\Driver\Exception * @throws DBALException */ public function findHierarchyHyperrelationRecordByParentNodeAnchor( diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Query/ProjectionHypergraphQuery.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Query/ProjectionHypergraphQuery.php index 5761b68031a..43c9527a7ba 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Query/ProjectionHypergraphQuery.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Query/ProjectionHypergraphQuery.php @@ -15,7 +15,7 @@ namespace Neos\ContentGraph\PostgreSQLAdapter\Domain\Projection\Query; use Doctrine\DBAL\Connection; -use Doctrine\DBAL\Driver\Result; +use Doctrine\DBAL\Result; use Doctrine\DBAL\Types\Types; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet; diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Query/ProjectionHypergraphQueryInterface.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Query/ProjectionHypergraphQueryInterface.php index 602bf71191d..1945a5fbd9e 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Query/ProjectionHypergraphQueryInterface.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Query/ProjectionHypergraphQueryInterface.php @@ -15,7 +15,7 @@ namespace Neos\ContentGraph\PostgreSQLAdapter\Domain\Projection\Query; use Doctrine\DBAL\Connection; -use Doctrine\DBAL\Driver\Result; +use Doctrine\DBAL\Result; /** * The interface to be implemented by projection hypergraph queries diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/Query/CommonGraphQueryOperations.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/Query/CommonGraphQueryOperations.php index 8bc7d349565..30ee2f53510 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/Query/CommonGraphQueryOperations.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/Query/CommonGraphQueryOperations.php @@ -15,7 +15,7 @@ namespace Neos\ContentGraph\PostgreSQLAdapter\Domain\Repository\Query; use Doctrine\DBAL\Connection; -use Doctrine\DBAL\ForwardCompatibility\Result as QueryResult; +use Doctrine\DBAL\Result as QueryResult; use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\NodeType\ExpandedNodeTypeCriteria; /** @@ -97,14 +97,8 @@ public function getTypes(): array return $this->types; } - /** - * @return QueryResult&iterable - */ final public function execute(Connection $databaseConnection): QueryResult { - /** @var QueryResult&iterable $result */ - $result = $databaseConnection->executeQuery($this->query, $this->parameters, $this->types); - - return $result; + return $databaseConnection->executeQuery($this->query, $this->parameters, $this->types); } } diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/Query/HypergraphQueryInterface.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/Query/HypergraphQueryInterface.php index e9407981985..8ee2d6cec3f 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/Query/HypergraphQueryInterface.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/Query/HypergraphQueryInterface.php @@ -15,7 +15,7 @@ namespace Neos\ContentGraph\PostgreSQLAdapter\Domain\Repository\Query; use Doctrine\DBAL\Connection; -use Doctrine\DBAL\Driver\ResultStatement; +use Doctrine\DBAL\Result; /** * The interface to be implemented by hypergraph queries @@ -25,7 +25,8 @@ interface HypergraphQueryInterface { /** - * @return ResultStatement + * @param Connection $databaseConnection + * @return Result */ - public function execute(Connection $databaseConnection): ResultStatement; + public function execute(Connection $databaseConnection): Result; } diff --git a/Neos.ContentRepository.Core/Classes/Infrastructure/DbalCheckpointStorage.php b/Neos.ContentRepository.Core/Classes/Infrastructure/DbalCheckpointStorage.php index dac81690564..772ade58daa 100644 --- a/Neos.ContentRepository.Core/Classes/Infrastructure/DbalCheckpointStorage.php +++ b/Neos.ContentRepository.Core/Classes/Infrastructure/DbalCheckpointStorage.php @@ -9,8 +9,8 @@ use Doctrine\DBAL\Exception\DriverException as DBALDriverException; use Doctrine\DBAL\Exception\LockWaitTimeoutException; use Doctrine\DBAL\Exception\UniqueConstraintViolationException; -use Doctrine\DBAL\Platforms\MySqlPlatform; -use Doctrine\DBAL\Platforms\PostgreSqlPlatform; +use Doctrine\DBAL\Platforms\MySQLPlatform; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\AbstractSchemaManager; use Doctrine\DBAL\Schema\Column; use Doctrine\DBAL\Schema\Table; @@ -26,7 +26,7 @@ */ final class DbalCheckpointStorage implements CheckpointStorageInterface { - private MySqlPlatform|PostgreSqlPlatform $platform; + private MySQLPlatform|PostgreSQLPlatform $platform; private SequenceNumber|null $lockedSequenceNumber = null; public function __construct( @@ -35,8 +35,8 @@ public function __construct( private readonly string $subscriberId, ) { $platform = $this->connection->getDatabasePlatform(); - if (!($platform instanceof MySqlPlatform || $platform instanceof PostgreSqlPlatform)) { - throw new \InvalidArgumentException(sprintf('The %s only supports the platforms %s and %s currently. Given: %s', $this::class, MySqlPlatform::class, PostgreSqlPlatform::class, get_debug_type($platform)), 1660556004); + if (!($platform instanceof MySQLPlatform || $platform instanceof PostgreSqlPlatform)) { + throw new \InvalidArgumentException(sprintf('The %s only supports the platforms %s and %s currently. Given: %s', $this::class, MySQLPlatform::class, PostgreSQLPlatform::class, get_debug_type($platform)), 1660556004); } if (strlen($this->subscriberId) > 255) { throw new \InvalidArgumentException('The subscriberId must not exceed 255 characters', 1705673456); @@ -94,7 +94,7 @@ public function acquireLock(): SequenceNumber ]); } catch (DBALException $exception) { $this->connection->rollBack(); - if ($exception instanceof LockWaitTimeoutException || ($exception instanceof DBALDriverException && ($exception->getErrorCode() === 3572 || $exception->getErrorCode() === 7))) { + if ($exception instanceof LockWaitTimeoutException) { throw new \RuntimeException(sprintf('Failed to acquire checkpoint lock for subscriber "%s" because it is acquired already', $this->subscriberId), 1652279016); } throw new \RuntimeException($exception->getMessage(), 1544207778, $exception); diff --git a/Neos.ContentRepository.Core/Classes/Infrastructure/DbalSchemaFactory.php b/Neos.ContentRepository.Core/Classes/Infrastructure/DbalSchemaFactory.php index 8f2d455f009..b3c375b6873 100644 --- a/Neos.ContentRepository.Core/Classes/Infrastructure/DbalSchemaFactory.php +++ b/Neos.ContentRepository.Core/Classes/Infrastructure/DbalSchemaFactory.php @@ -4,9 +4,12 @@ namespace Neos\ContentRepository\Core\Infrastructure; +use Doctrine\DBAL\Exception; +use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Schema\AbstractSchemaManager; use Doctrine\DBAL\Schema\Column; use Doctrine\DBAL\Schema\Schema; +use Doctrine\DBAL\Schema\SchemaException; use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Types; @@ -116,9 +119,11 @@ public static function columnForNodeTypeName(string $columnName): Column } /** - * @param AbstractSchemaManager $schemaManager + * @param AbstractSchemaManager $schemaManager * @param Table[] $tables * @return Schema + * @throws Exception + * @throws SchemaException */ public static function createSchemaWithTables(AbstractSchemaManager $schemaManager, array $tables): Schema { diff --git a/Neos.ContentRepository.Core/Classes/Projection/Workspace/WorkspaceFinder.php b/Neos.ContentRepository.Core/Classes/Projection/Workspace/WorkspaceFinder.php index 4ec004a9cce..ebaf7f3993a 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/Workspace/WorkspaceFinder.php +++ b/Neos.ContentRepository.Core/Classes/Projection/Workspace/WorkspaceFinder.php @@ -15,6 +15,7 @@ namespace Neos\ContentRepository\Core\Projection\Workspace; use Doctrine\DBAL\Connection; +use Doctrine\DBAL\Exception as DbalException; use Neos\ContentRepository\Core\Projection\ProjectionStateInterface; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceDescription; @@ -91,7 +92,7 @@ public function findOneByCurrentContentStreamId( /** * @return array - * @throws \Doctrine\DBAL\DBALException + * @throws DbalException */ public function findByBaseWorkspace(WorkspaceName $baseWorkspace): array { @@ -155,7 +156,7 @@ public function findAll(): Workspaces /** * @return array * @throws \Doctrine\DBAL\Driver\Exception - * @throws \Doctrine\DBAL\Exception + * @throws DbalException */ public function findOutdated(): array { diff --git a/Neos.ContentRepository.Core/composer.json b/Neos.ContentRepository.Core/composer.json index 56bdba56ad6..9885e3b51ac 100644 --- a/Neos.ContentRepository.Core/composer.json +++ b/Neos.ContentRepository.Core/composer.json @@ -17,7 +17,7 @@ "neos/error-messages": "*", "neos/utility-objecthandling": "*", "neos/utility-arrays": "*", - "doctrine/dbal": "^2.13", + "doctrine/dbal": "^3.2", "symfony/serializer": "^6.3", "psr/clock": "^1", "behat/transliterator": "~1.0", diff --git a/Neos.ContentRepository.LegacyNodeMigration/Classes/Command/CrCommandController.php b/Neos.ContentRepository.LegacyNodeMigration/Classes/Command/CrCommandController.php index cff112dd638..31ceaea585d 100644 --- a/Neos.ContentRepository.LegacyNodeMigration/Classes/Command/CrCommandController.php +++ b/Neos.ContentRepository.LegacyNodeMigration/Classes/Command/CrCommandController.php @@ -163,7 +163,9 @@ private function adjustDataBaseConnection(Connection $connection): Connection $connectionParams['port'] = isset($port) ? (int)$port : null; $connectionParams['dbname'] = $this->output->ask(sprintf('DB name? [%s] ',$connectionParams['dbname'] ?? ''), $connectionParams['dbname'] ?? null); $connectionParams['user'] = $this->output->ask(sprintf('DB user? [%s] ',$connectionParams['user'] ?? ''), $connectionParams['user'] ?? null); + /** @phpstan-ignore-next-line */ $connectionParams['password'] = $this->output->askHiddenResponse(sprintf('DB password? [%s]', str_repeat('*', strlen($connectionParams['password'] ?? '')))) ?? $connectionParams['password']; + /** @phpstan-ignore-next-line */ return DriverManager::getConnection($connectionParams, new Configuration()); } diff --git a/Neos.ContentRepository.LegacyNodeMigration/Classes/Helpers/AssetExtractor.php b/Neos.ContentRepository.LegacyNodeMigration/Classes/Helpers/AssetExtractor.php index 074ce1b91e3..5c4727bdbde 100644 --- a/Neos.ContentRepository.LegacyNodeMigration/Classes/Helpers/AssetExtractor.php +++ b/Neos.ContentRepository.LegacyNodeMigration/Classes/Helpers/AssetExtractor.php @@ -3,7 +3,7 @@ namespace Neos\ContentRepository\LegacyNodeMigration\Helpers; -use Doctrine\DBAL\Platforms\PostgreSQL100Platform; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Neos\ContentRepository\Core\NodeType\NodeTypeName; use Neos\ContentRepository\LegacyNodeMigration\Exception\MigrationException; use Neos\Flow\Persistence\Doctrine\DataTypes\JsonArrayType; @@ -32,7 +32,7 @@ public function run(iterable $nodeDataRows): iterable $nodeTypeName = NodeTypeName::fromString($nodeDataRow['nodetype']); try { // Note: We use a PostgreSQL platform because the implementation is forward-compatible, @see JsonArrayType::convertToPHPValue() - $decodedProperties = (new JsonArrayType())->convertToPHPValue($nodeDataRow['properties'], new PostgreSQL100Platform()); + $decodedProperties = (new JsonArrayType())->convertToPHPValue($nodeDataRow['properties'], new PostgreSQLPlatform()); } catch (\Throwable $e) { throw new MigrationException(sprintf('Failed to decode properties %s of node "%s" (type: "%s"): %s', json_encode($nodeDataRow['properties']), $nodeDataRow['identifier'], $nodeTypeName->value, $e->getMessage()), 1656057030, $e); } diff --git a/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToEventsProcessor.php b/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToEventsProcessor.php index ff601dc7ab4..56aaa7fbad7 100644 --- a/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToEventsProcessor.php +++ b/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToEventsProcessor.php @@ -4,7 +4,7 @@ namespace Neos\ContentRepository\LegacyNodeMigration; -use Doctrine\DBAL\Platforms\PostgreSQL100Platform; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Types\ConversionException; use League\Flysystem\Filesystem; use League\Flysystem\FilesystemException; @@ -53,7 +53,6 @@ use Neos\Flow\Persistence\Doctrine\DataTypes\JsonArrayType; use Neos\Flow\Property\PropertyMapper; use Neos\Neos\Domain\Service\NodeTypeNameFactory; -use Ramsey\Uuid\Uuid; use Webmozart\Assert\Assert; final class NodeDataToEventsProcessor implements ProcessorInterface @@ -339,7 +338,7 @@ public function extractPropertyValuesAndReferences(array $nodeDataRow, NodeType // Note: We use a PostgreSQL platform because the implementation is forward-compatible, @see JsonArrayType::convertToPHPValue() try { - $decodedProperties = (new JsonArrayType())->convertToPHPValue($nodeDataRow['properties'], new PostgreSQL100Platform()); + $decodedProperties = (new JsonArrayType())->convertToPHPValue($nodeDataRow['properties'], new PostgreSQLPlatform()); } catch (ConversionException $exception) { throw new MigrationException(sprintf('Failed to decode properties %s of node "%s" (type: "%s"): %s', json_encode($nodeDataRow['properties']), $nodeDataRow['identifier'], $nodeType->name->value, $exception->getMessage()), 1695391558, $exception); } diff --git a/Neos.Media/composer.json b/Neos.Media/composer.json index 075e89dab66..a32e230aa24 100644 --- a/Neos.Media/composer.json +++ b/Neos.Media/composer.json @@ -21,7 +21,7 @@ "imagine/imagine": "*", "doctrine/common": "^2.7 || ^3.0", "doctrine/orm": "^2.6", - "doctrine/dbal": "^2.8" + "doctrine/dbal": "^3.2" }, "replace": { "typo3/media": "self.version" diff --git a/Neos.Neos/Classes/AssetUsage/Projection/AssetUsageRepository.php b/Neos.Neos/Classes/AssetUsage/Projection/AssetUsageRepository.php index 3de07925cc1..df07e710ed3 100644 --- a/Neos.Neos/Classes/AssetUsage/Projection/AssetUsageRepository.php +++ b/Neos.Neos/Classes/AssetUsage/Projection/AssetUsageRepository.php @@ -7,7 +7,7 @@ use Doctrine\DBAL\Connection; use Doctrine\DBAL\Exception as DbalException; use Doctrine\DBAL\Exception\UniqueConstraintViolationException; -use Doctrine\DBAL\ForwardCompatibility\Result; +use Doctrine\DBAL\Result; use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Schema\AbstractSchemaManager; use Doctrine\DBAL\Schema\Column; diff --git a/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathFinder.php b/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathFinder.php index 8c78fc04108..c42d1553b46 100644 --- a/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathFinder.php +++ b/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathFinder.php @@ -5,7 +5,7 @@ namespace Neos\Neos\FrontendRouting\Projection; use Doctrine\DBAL\Connection; -use Doctrine\DBAL\DBALException; +use Doctrine\DBAL\Exception as DbalException; use Neos\ContentRepository\Core\Projection\ProjectionStateInterface; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; @@ -224,7 +224,7 @@ public function getLiveContentStreamId(): ContentStreamId { if ($this->liveContentStreamIdRuntimeCache === null) { try { - $contentStreamId = $this->dbal->fetchColumn( + $contentStreamId = $this->dbal->fetchOne( 'SELECT contentStreamId FROM ' . $this->tableNamePrefix . '_livecontentstreams LIMIT 1' ); diff --git a/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathProjection.php b/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathProjection.php index f6269e7cba3..515dc31d1a5 100644 --- a/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathProjection.php +++ b/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathProjection.php @@ -5,7 +5,7 @@ namespace Neos\Neos\FrontendRouting\Projection; use Doctrine\DBAL\Connection; -use Doctrine\DBAL\DBALException; +use Doctrine\DBAL\Exception as DBALException; use Doctrine\DBAL\Schema\AbstractSchemaManager; use Doctrine\DBAL\Types\Types; use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint; diff --git a/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathSchemaBuilder.php b/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathSchemaBuilder.php index aa074353049..69fdfccf2f6 100644 --- a/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathSchemaBuilder.php +++ b/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathSchemaBuilder.php @@ -2,9 +2,12 @@ namespace Neos\Neos\FrontendRouting\Projection; +use Doctrine\DBAL\Exception as DbalException; +use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Schema\AbstractSchemaManager; use Doctrine\DBAL\Schema\Column; use Doctrine\DBAL\Schema\Schema; +use Doctrine\DBAL\Schema\SchemaException; use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Types; @@ -19,6 +22,12 @@ public function __construct( ) { } + /** + * @param AbstractSchemaManager $schemaManager + * @return Schema + * @throws DbalException + * @throws SchemaException + */ public function buildSchema(AbstractSchemaManager $schemaManager): Schema { $schema = DbalSchemaFactory::createSchemaWithTables($schemaManager, [ diff --git a/Neos.Neos/Classes/PendingChangesProjection/ChangeFinder.php b/Neos.Neos/Classes/PendingChangesProjection/ChangeFinder.php index ef797900572..512eb585b29 100644 --- a/Neos.Neos/Classes/PendingChangesProjection/ChangeFinder.php +++ b/Neos.Neos/Classes/PendingChangesProjection/ChangeFinder.php @@ -46,7 +46,7 @@ public function findByContentStreamId(ContentStreamId $contentStreamId): array WHERE contentStreamId = :contentStreamId ', [ - ':contentStreamId' => $contentStreamId->value + 'contentStreamId' => $contentStreamId->value ] )->fetchAll(); $changes = []; @@ -64,7 +64,7 @@ public function countByContentStreamId(ContentStreamId $contentStreamId): int WHERE contentStreamId = :contentStreamId ', [ - ':contentStreamId' => $contentStreamId->value + 'contentStreamId' => $contentStreamId->value ] )->rowCount(); } diff --git a/Neos.Neos/Classes/PendingChangesProjection/ChangeProjection.php b/Neos.Neos/Classes/PendingChangesProjection/ChangeProjection.php index 574354ca99f..013e66adf56 100644 --- a/Neos.Neos/Classes/PendingChangesProjection/ChangeProjection.php +++ b/Neos.Neos/Classes/PendingChangesProjection/ChangeProjection.php @@ -15,9 +15,10 @@ namespace Neos\Neos\PendingChangesProjection; use Doctrine\DBAL\Connection; -use Doctrine\DBAL\DBALException; +use Doctrine\DBAL\Exception as DBALException; use Doctrine\DBAL\Schema\AbstractSchemaManager; use Doctrine\DBAL\Schema\Column; +use Doctrine\DBAL\Schema\SchemaException; use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Types; @@ -79,7 +80,10 @@ public function __construct( ); } - + /** + * @return void + * @throws DBALException + */ public function setUp(): void { foreach ($this->determineRequiredSqlStatements() as $statement) { @@ -115,14 +119,13 @@ public function status(): ProjectionStatus /** * @return array + * @throws DBALException + * @throws SchemaException */ private function determineRequiredSqlStatements(): array { $connection = $this->dbal; - $schemaManager = $connection->getSchemaManager(); - if (!$schemaManager instanceof AbstractSchemaManager) { - throw new \RuntimeException('Failed to retrieve Schema Manager', 1625653914); - } + $schemaManager = $connection->createSchemaManager(); $changeTable = new Table($this->tableNamePrefix, [ DbalSchemaFactory::columnForContentStreamId('contentStreamId')->setNotNull(true), diff --git a/Neos.Neos/Tests/Behavior/Features/Bootstrap/RoutingTrait.php b/Neos.Neos/Tests/Behavior/Features/Bootstrap/RoutingTrait.php index a8c15990295..b3a8a1b399e 100644 --- a/Neos.Neos/Tests/Behavior/Features/Bootstrap/RoutingTrait.php +++ b/Neos.Neos/Tests/Behavior/Features/Bootstrap/RoutingTrait.php @@ -290,7 +290,7 @@ public function tableContainsExactly(TableNode $expectedRows): void $tablePrefix = DocumentUriPathProjectionFactory::projectionTableNamePrefix( $this->currentContentRepository->id ); - $actualResult = $dbal->fetchAll('SELECT ' . $columns . ' FROM ' . $tablePrefix . '_uri ORDER BY nodeaggregateidpath'); + $actualResult = $dbal->fetchAllAssociative('SELECT ' . $columns . ' FROM ' . $tablePrefix . '_uri ORDER BY nodeaggregateidpath'); $expectedResult = array_map(static function (array $row) { return array_map(static function (string $cell) { return json_decode($cell, true, 512, JSON_THROW_ON_ERROR); diff --git a/Neos.Workspace.Ui/Classes/Controller/WorkspaceController.php b/Neos.Workspace.Ui/Classes/Controller/WorkspaceController.php index a76443dd849..d90b3eb09fe 100644 --- a/Neos.Workspace.Ui/Classes/Controller/WorkspaceController.php +++ b/Neos.Workspace.Ui/Classes/Controller/WorkspaceController.php @@ -14,7 +14,7 @@ namespace Neos\Workspace\Ui\Controller; -use Doctrine\DBAL\DBALException; +use Doctrine\DBAL\Exception as DbalException; use Neos\ContentRepository\Core\ContentRepository; use Neos\ContentRepository\Core\Feature\WorkspaceCreation\Command\CreateWorkspace; use Neos\ContentRepository\Core\Feature\WorkspaceCreation\Exception\WorkspaceAlreadyExists; @@ -351,7 +351,7 @@ public function updateAction( * @throws IndexOutOfBoundsException * @throws InvalidFormatPlaceholderException * @throws StopActionException - * @throws DBALException + * @throws DbalException */ public function deleteAction(WorkspaceName $workspaceName): void { diff --git a/composer.json b/composer.json index bbbedbbadd6..358a96770ad 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,7 @@ "type": "neos-package-collection", "require": { "neos/flow-development-collection": "9.0.x-dev", - "doctrine/dbal": "^2.8", + "doctrine/dbal": "^3.2", "doctrine/migrations": "*", "neos/eventstore": "^1", "neos/eventstore-doctrineadapter": "^1 || ^2", From d01548b1567bf9afc9dd918bf3d6b05aa38c31ef Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Thu, 4 Jul 2024 10:17:04 +0200 Subject: [PATCH 2/8] TASK: Adjust doctrine exception namespaces --- .../Classes/Command/MediaCommandController.php | 2 +- .../Migrations/Mysql/Version20181104152203.php | 12 ++++++------ .../Migrations/Mysql/Version20191125132700.php | 4 ++-- .../Migrations/Mysql/Version20200306233229.php | 2 +- .../Migrations/Mysql/Version20200823164700.php | 4 ++-- .../Migrations/Mysql/Version20200828170100.php | 4 ++-- .../Migrations/Postgresql/Version20181104152204.php | 12 ++++++------ .../Migrations/Postgresql/Version20190315122901.php | 4 ++-- .../Migrations/Postgresql/Version20191125132701.php | 4 ++-- .../Migrations/Postgresql/Version20200307122055.php | 2 +- .../Migrations/Postgresql/Version20200823164701.php | 4 ++-- .../Migrations/Postgresql/Version20200828170101.php | 4 ++-- Neos.Neos/Migrations/Mysql/Version20211220145601.php | 2 +- .../Migrations/Postgresql/Version20211220145602.php | 2 +- 14 files changed, 31 insertions(+), 31 deletions(-) diff --git a/Neos.Media/Classes/Command/MediaCommandController.php b/Neos.Media/Classes/Command/MediaCommandController.php index 10925aff8d7..21cddcec330 100644 --- a/Neos.Media/Classes/Command/MediaCommandController.php +++ b/Neos.Media/Classes/Command/MediaCommandController.php @@ -15,7 +15,7 @@ use Doctrine\Common\Collections\Collection; use Doctrine\DBAL\Connection; -use Doctrine\DBAL\DBALException; +use Doctrine\DBAL\Exception as DbalException; use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManagerInterface; use Neos\Flow\Annotations as Flow; diff --git a/Neos.Media/Migrations/Mysql/Version20181104152203.php b/Neos.Media/Migrations/Mysql/Version20181104152203.php index 7a4c2e491f6..eee7c1ce263 100644 --- a/Neos.Media/Migrations/Mysql/Version20181104152203.php +++ b/Neos.Media/Migrations/Mysql/Version20181104152203.php @@ -11,8 +11,8 @@ * source code. */ -use Doctrine\DBAL\DBALException; -use Doctrine\DBAL\Migrations\AbortMigrationException; +use Doctrine\DBAL\Exception as DbalException; +use Doctrine\Migrations\Exception\AbortMigration as AbortMigrationException; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; @@ -22,7 +22,7 @@ class Version20181104152203 extends AbstractMigration /** * @return string */ - public function getDescription(): string + public function getDescription(): string { return 'Introduce copyright notice'; } @@ -33,7 +33,7 @@ public function getDescription(): string * @throws DBALException * @throws AbortMigrationException */ - public function up(Schema $schema): void + public function up(Schema $schema): void { // this up() migration is autogenerated, please modify it to your needs $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); @@ -47,11 +47,11 @@ public function up(Schema $schema): void * @throws DBALException * @throws AbortMigrationException */ - public function down(Schema $schema): void + public function down(Schema $schema): void { // this down() migration is autogenerated, please modify it to your needs $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); - + $this->addSql('ALTER TABLE neos_media_domain_model_asset DROP copyrightnotice'); } } diff --git a/Neos.Media/Migrations/Mysql/Version20191125132700.php b/Neos.Media/Migrations/Mysql/Version20191125132700.php index 5e0a529d0d9..42563f172de 100644 --- a/Neos.Media/Migrations/Mysql/Version20191125132700.php +++ b/Neos.Media/Migrations/Mysql/Version20191125132700.php @@ -3,8 +3,8 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\DBAL\DBALException; -use Doctrine\DBAL\Migrations\AbortMigrationException; +use Doctrine\DBAL\Exception as DbalException; +use Doctrine\Migrations\Exception\AbortMigration as AbortMigrationException; use Doctrine\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; diff --git a/Neos.Media/Migrations/Mysql/Version20200306233229.php b/Neos.Media/Migrations/Mysql/Version20200306233229.php index 6a71c55fe5f..91a5b7b2a1c 100644 --- a/Neos.Media/Migrations/Mysql/Version20200306233229.php +++ b/Neos.Media/Migrations/Mysql/Version20200306233229.php @@ -5,7 +5,7 @@ use Doctrine\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; -use Doctrine\DBAL\Migrations\AbortMigrationException; +use Doctrine\Migrations\Exception\AbortMigration as AbortMigrationException; class Version20200306233229 extends AbstractMigration { diff --git a/Neos.Media/Migrations/Mysql/Version20200823164700.php b/Neos.Media/Migrations/Mysql/Version20200823164700.php index ef698af8695..a77431c6a83 100644 --- a/Neos.Media/Migrations/Mysql/Version20200823164700.php +++ b/Neos.Media/Migrations/Mysql/Version20200823164700.php @@ -3,8 +3,8 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\DBAL\DBALException; -use Doctrine\DBAL\Migrations\AbortMigrationException; +use Doctrine\DBAL\Exception as DbalException; +use Doctrine\Migrations\Exception\AbortMigration as AbortMigrationException; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; diff --git a/Neos.Media/Migrations/Mysql/Version20200828170100.php b/Neos.Media/Migrations/Mysql/Version20200828170100.php index b216aba3074..a5ebe1092c6 100644 --- a/Neos.Media/Migrations/Mysql/Version20200828170100.php +++ b/Neos.Media/Migrations/Mysql/Version20200828170100.php @@ -3,8 +3,8 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\DBAL\DBALException; -use Doctrine\DBAL\Migrations\AbortMigrationException; +use Doctrine\DBAL\Exception as DbalException; +use Doctrine\Migrations\Exception\AbortMigration as AbortMigrationException; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; diff --git a/Neos.Media/Migrations/Postgresql/Version20181104152204.php b/Neos.Media/Migrations/Postgresql/Version20181104152204.php index 9cf35587ea2..bb7c3fa7105 100644 --- a/Neos.Media/Migrations/Postgresql/Version20181104152204.php +++ b/Neos.Media/Migrations/Postgresql/Version20181104152204.php @@ -11,8 +11,8 @@ * source code. */ -use Doctrine\DBAL\DBALException; -use Doctrine\DBAL\Migrations\AbortMigrationException; +use Doctrine\DBAL\Exception as DbalException; +use Doctrine\Migrations\Exception\AbortMigration as AbortMigrationException; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; @@ -22,7 +22,7 @@ class Version20181104152204 extends AbstractMigration /** * @return string */ - public function getDescription(): string + public function getDescription(): string { return 'Introduce copyright notice'; } @@ -33,7 +33,7 @@ public function getDescription(): string * @throws DBALException * @throws AbortMigrationException */ - public function up(Schema $schema): void + public function up(Schema $schema): void { // this up() migration is autogenerated, please modify it to your needs $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); @@ -47,11 +47,11 @@ public function up(Schema $schema): void * @throws DBALException * @throws AbortMigrationException */ - public function down(Schema $schema): void + public function down(Schema $schema): void { // this down() migration is autogenerated, please modify it to your needs $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); - + $this->addSql('ALTER TABLE neos_media_domain_model_asset DROP copyrightnotice'); } } diff --git a/Neos.Media/Migrations/Postgresql/Version20190315122901.php b/Neos.Media/Migrations/Postgresql/Version20190315122901.php index b6f43c81260..9d7f883c420 100644 --- a/Neos.Media/Migrations/Postgresql/Version20190315122901.php +++ b/Neos.Media/Migrations/Postgresql/Version20190315122901.php @@ -1,8 +1,8 @@ Date: Thu, 4 Jul 2024 10:21:36 +0200 Subject: [PATCH 3/8] TASK: Replace deprecated `getSchemaManager` with `createSchemaManager` --- .../src/DoctrineDbalContentGraphProjection.php | 5 +---- .../src/Domain/Projection/HypergraphProjection.php | 5 ----- .../Classes/Infrastructure/DbalCheckpointStorage.php | 5 +---- .../Classes/Infrastructure/DbalSchemaDiff.php | 5 +---- .../Projection/ContentStream/ContentStreamProjection.php | 6 +----- .../Classes/Projection/Workspace/WorkspaceProjection.php | 6 +----- .../Classes/AssetUsage/Projection/AssetUsageRepository.php | 5 +---- .../Projection/DocumentUriPathProjection.php | 5 +---- Neos.Neos/Migrations/Mysql/Version20121030221151.php | 4 ++-- Neos.Neos/Migrations/Mysql/Version20131111235827.php | 4 ++-- Neos.Neos/Migrations/Mysql/Version20141017174559.php | 2 +- Neos.Neos/Migrations/Mysql/Version20151117125551.php | 4 ++-- Neos.Neos/Migrations/Mysql/Version20151223125909.php | 4 ++-- Neos.Neos/Migrations/Mysql/Version20160104121311.php | 4 ++-- Neos.Neos/Migrations/Mysql/Version20161125124749.php | 4 ++-- Neos.Neos/Migrations/Postgresql/Version20121030103851.php | 4 ++-- Neos.Neos/Migrations/Postgresql/Version20131112191120.php | 4 ++-- Neos.Neos/Migrations/Postgresql/Version20151117125552.php | 4 ++-- Neos.Neos/Migrations/Postgresql/Version20151120170812.php | 4 ++-- Neos.Neos/Migrations/Postgresql/Version20151223125946.php | 4 ++-- Neos.Neos/Migrations/Postgresql/Version20160104121413.php | 4 ++-- Neos.Neos/Migrations/Postgresql/Version20161125125249.php | 4 ++-- Neos.NodeTypes/Migrations/Mysql/Version20161125123504.php | 4 ++-- .../Migrations/Postgresql/Version20161125125004.php | 4 ++-- 24 files changed, 38 insertions(+), 66 deletions(-) diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php index d2b530d7333..50c914166e3 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php @@ -646,10 +646,7 @@ private function whenSubtreeWasUntagged(SubtreeWasUntagged $event): void */ private function determineRequiredSqlStatements(): array { - $schemaManager = $this->dbal->getSchemaManager(); - if (!$schemaManager instanceof AbstractSchemaManager) { - throw new \RuntimeException('Failed to retrieve Schema Manager', 1625653914); - } + $schemaManager = $this->dbal->createSchemaManager(); $schema = (new DoctrineDbalContentGraphSchemaBuilder($this->tableNames))->buildSchema($schemaManager); return DbalSchemaDiff::determineRequiredSqlStatements($this->dbal, $schema); } diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/HypergraphProjection.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/HypergraphProjection.php index 2de68648353..6b683bbd08d 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/HypergraphProjection.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/HypergraphProjection.php @@ -132,11 +132,6 @@ public function status(): ProjectionStatus private function determineRequiredSqlStatements(): array { HypergraphSchemaBuilder::registerTypes($this->dbal->getDatabasePlatform()); - $schemaManager = $this->dbal->getSchemaManager(); - if (!$schemaManager instanceof AbstractSchemaManager) { - throw new \RuntimeException('Failed to retrieve Schema Manager', 1625653914); - } - $schema = (new HypergraphSchemaBuilder($this->tableNamePrefix))->buildSchema(); return DbalSchemaDiff::determineRequiredSqlStatements($this->dbal, $schema); } diff --git a/Neos.ContentRepository.Core/Classes/Infrastructure/DbalCheckpointStorage.php b/Neos.ContentRepository.Core/Classes/Infrastructure/DbalCheckpointStorage.php index 772ade58daa..8cdba5c5e8c 100644 --- a/Neos.ContentRepository.Core/Classes/Infrastructure/DbalCheckpointStorage.php +++ b/Neos.ContentRepository.Core/Classes/Infrastructure/DbalCheckpointStorage.php @@ -150,10 +150,7 @@ public function getHighestAppliedSequenceNumber(): SequenceNumber */ private function determineRequiredSqlStatements(): array { - $schemaManager = $this->connection->getSchemaManager(); - if (!$schemaManager instanceof AbstractSchemaManager) { - throw new \RuntimeException('Failed to retrieve Schema Manager', 1705681161); - } + $schemaManager = $this->connection->createSchemaManager(); $tableSchema = new Table( $this->tableName, [ diff --git a/Neos.ContentRepository.Core/Classes/Infrastructure/DbalSchemaDiff.php b/Neos.ContentRepository.Core/Classes/Infrastructure/DbalSchemaDiff.php index 1af625d9def..e1df226d452 100644 --- a/Neos.ContentRepository.Core/Classes/Infrastructure/DbalSchemaDiff.php +++ b/Neos.ContentRepository.Core/Classes/Infrastructure/DbalSchemaDiff.php @@ -28,10 +28,7 @@ private function __construct() */ public static function determineRequiredSqlStatements(Connection $connection, Schema $schema): array { - $schemaManager = $connection->getSchemaManager(); - if (!$schemaManager instanceof AbstractSchemaManager) { - throw new \RuntimeException('Failed to retrieve Schema Manager', 1705679142); - } + $schemaManager = $connection->createSchemaManager(); try { $platform = $connection->getDatabasePlatform(); } catch (Exception $e) { diff --git a/Neos.ContentRepository.Core/Classes/Projection/ContentStream/ContentStreamProjection.php b/Neos.ContentRepository.Core/Classes/Projection/ContentStream/ContentStreamProjection.php index b362bdb5b66..c3aa38c2434 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/ContentStream/ContentStreamProjection.php +++ b/Neos.ContentRepository.Core/Classes/Projection/ContentStream/ContentStreamProjection.php @@ -120,11 +120,7 @@ public function status(): ProjectionStatus */ private function determineRequiredSqlStatements(): array { - $schemaManager = $this->dbal->getSchemaManager(); - if (!$schemaManager instanceof AbstractSchemaManager) { - throw new \RuntimeException('Failed to retrieve Schema Manager', 1625653914); - } - + $schemaManager = $this->dbal->createSchemaManager(); $schema = DbalSchemaFactory::createSchemaWithTables($schemaManager, [ (new Table($this->tableName, [ DbalSchemaFactory::columnForContentStreamId('contentStreamId')->setNotnull(true), diff --git a/Neos.ContentRepository.Core/Classes/Projection/Workspace/WorkspaceProjection.php b/Neos.ContentRepository.Core/Classes/Projection/Workspace/WorkspaceProjection.php index a069f587577..db872319ac4 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/Workspace/WorkspaceProjection.php +++ b/Neos.ContentRepository.Core/Classes/Projection/Workspace/WorkspaceProjection.php @@ -111,11 +111,7 @@ public function status(): ProjectionStatus */ private function determineRequiredSqlStatements(): array { - $schemaManager = $this->dbal->getSchemaManager(); - if (!$schemaManager instanceof AbstractSchemaManager) { - throw new \RuntimeException('Failed to retrieve Schema Manager', 1625653914); - } - + $schemaManager = $this->dbal->createSchemaManager(); $workspaceTable = new Table($this->tableName, [ (new Column('workspacename', Type::getType(Types::STRING)))->setLength(255)->setNotnull(true)->setCustomSchemaOption('collation', self::DEFAULT_TEXT_COLLATION), (new Column('baseworkspacename', Type::getType(Types::STRING)))->setLength(255)->setNotnull(false)->setCustomSchemaOption('collation', self::DEFAULT_TEXT_COLLATION), diff --git a/Neos.Neos/Classes/AssetUsage/Projection/AssetUsageRepository.php b/Neos.Neos/Classes/AssetUsage/Projection/AssetUsageRepository.php index df07e710ed3..1760fb5c1e1 100644 --- a/Neos.Neos/Classes/AssetUsage/Projection/AssetUsageRepository.php +++ b/Neos.Neos/Classes/AssetUsage/Projection/AssetUsageRepository.php @@ -60,10 +60,7 @@ public function isSetupRequired(): false|string private function databaseSchema(): Schema { - $schemaManager = $this->dbal->getSchemaManager(); - if (!$schemaManager instanceof AbstractSchemaManager) { - throw new \RuntimeException('Failed to retrieve Schema Manager', 1625653914); - } + $schemaManager = $this->dbal->createSchemaManager(); $table = new Table($this->tableNamePrefix, [ (new Column('assetid', Type::getType(Types::STRING)))->setLength(40)->setNotnull(true)->setDefault(''), (new Column('originalassetid', Type::getType(Types::STRING)))->setLength(40)->setNotnull(false)->setDefault(null), diff --git a/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathProjection.php b/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathProjection.php index 515dc31d1a5..7128d92a049 100644 --- a/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathProjection.php +++ b/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathProjection.php @@ -108,10 +108,7 @@ public function status(): ProjectionStatus */ private function determineRequiredSqlStatements(): array { - $schemaManager = $this->dbal->getSchemaManager(); - if (!$schemaManager instanceof AbstractSchemaManager) { - throw new \RuntimeException('Failed to retrieve Schema Manager', 1625653914); - } + $schemaManager = $this->dbal->createSchemaManager(); $schema = (new DocumentUriPathSchemaBuilder($this->tableNamePrefix))->buildSchema($schemaManager); return DbalSchemaDiff::determineRequiredSqlStatements($this->dbal, $schema); } diff --git a/Neos.Neos/Migrations/Mysql/Version20121030221151.php b/Neos.Neos/Migrations/Mysql/Version20121030221151.php index caa339ec9fc..bd26bc671d8 100644 --- a/Neos.Neos/Migrations/Mysql/Version20121030221151.php +++ b/Neos.Neos/Migrations/Mysql/Version20121030221151.php @@ -25,7 +25,7 @@ public function up(Schema $schema): void $this->addSql("UPDATE typo3_party_domain_model_abstractparty SET dtype = 'typo3_neos_user' WHERE dtype = 'typo3_typo3_user'"); - $schemaManager = $this->connection->getSchemaManager(); + $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_contentobjectproxy']); if ($hasTables) { $this->addSql("UPDATE typo3_typo3cr_domain_model_contentobjectproxy SET targettype = 'TYPO3\\Neos\\Domain\\Model\\Site' WHERE targettype = 'TYPO3\\TYPO3\\Domain\\Model\\Site'"); @@ -46,7 +46,7 @@ public function down(Schema $schema): void $this->addSql("ALTER TABLE typo3_neos_domain_model_user RENAME TO typo3_typo3_domain_model_user"); $this->addSql("UPDATE typo3_party_domain_model_abstractparty SET dtype = 'typo3_typo3_user' WHERE dtype = 'typo3_neos_user'"); - $schemaManager = $this->connection->getSchemaManager(); + $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_contentobjectproxy']); if ($hasTables) { $this->addSql("UPDATE typo3_typo3cr_domain_model_contentobjectproxy SET targettype = 'TYPO3\\TYPO3\\Domain\\Model\\Site' WHERE targettype = 'TYPO3\\Neos\\Domain\\Model\\Site'"); diff --git a/Neos.Neos/Migrations/Mysql/Version20131111235827.php b/Neos.Neos/Migrations/Mysql/Version20131111235827.php index e9f4d280106..eff5799e818 100644 --- a/Neos.Neos/Migrations/Mysql/Version20131111235827.php +++ b/Neos.Neos/Migrations/Mysql/Version20131111235827.php @@ -17,7 +17,7 @@ class Version20131111235827 extends AbstractMigration public function up(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); - $schemaManager = $this->connection->getSchemaManager(); + $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_nodedata']); if ($hasTables) { $this->addSql("UPDATE typo3_typo3cr_domain_model_nodedata SET contentobjectproxy = NULL, nodetype = 'TYPO3.Neos:Shortcut' WHERE parentpath = '/sites' AND nodetype = 'unstructured'"); @@ -31,7 +31,7 @@ public function up(Schema $schema): void public function down(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); - $schemaManager = $this->connection->getSchemaManager(); + $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_nodedata']); if ($hasTables) { $this->addSql("UPDATE typo3_typo3cr_domain_model_nodedata SET contentobjectproxy = (SELECT c.persistence_object_identifier FROM typo3_typo3cr_domain_model_contentobjectproxy AS c, typo3_neos_domain_model_site AS s WHERE c.targetid = s.persistence_object_identifier AND c.targettype = 'TYPO3\\Neos\\Domain\\Model\\Site' AND s.nodename = SUBSTRING(typo3_typo3cr_domain_model_nodedata.path, 8)), nodetype = 'unstructured' WHERE contentobjectproxy IS NULL AND parentpath = '/sites' AND nodetype = 'TYPO3.Neos:Shortcut'"); diff --git a/Neos.Neos/Migrations/Mysql/Version20141017174559.php b/Neos.Neos/Migrations/Mysql/Version20141017174559.php index 5b19791dba7..886738c9a9f 100644 --- a/Neos.Neos/Migrations/Mysql/Version20141017174559.php +++ b/Neos.Neos/Migrations/Mysql/Version20141017174559.php @@ -17,7 +17,7 @@ class Version20141017174559 extends AbstractMigration public function up(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); - $schemaManager = $this->connection->getSchemaManager(); + $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_nodedata']); if ($hasTables) { $this->addSql("UPDATE typo3_typo3cr_domain_model_nodedata SET properties = REPLACE(properties, 'O:37:\"TYPO3\\\\Media\\\\Domain\\\\Model\\\\ImageVariant\"', 'a');"); diff --git a/Neos.Neos/Migrations/Mysql/Version20151117125551.php b/Neos.Neos/Migrations/Mysql/Version20151117125551.php index b19925a35e2..f23dffcf634 100644 --- a/Neos.Neos/Migrations/Mysql/Version20151117125551.php +++ b/Neos.Neos/Migrations/Mysql/Version20151117125551.php @@ -18,7 +18,7 @@ public function up(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); - $schemaManager = $this->connection->getSchemaManager(); + $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_workspace']); if ($hasTables) { $workspacesQuery @@ -48,7 +48,7 @@ public function up(Schema $schema): void public function down(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); - $schemaManager = $this->connection->getSchemaManager(); + $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_workspace']); if ($hasTables) { $this->addSql('UPDATE typo3_typo3cr_domain_model_workspace SET owner = NULL'); diff --git a/Neos.Neos/Migrations/Mysql/Version20151223125909.php b/Neos.Neos/Migrations/Mysql/Version20151223125909.php index 1bdc4235e95..86556582ca8 100644 --- a/Neos.Neos/Migrations/Mysql/Version20151223125909.php +++ b/Neos.Neos/Migrations/Mysql/Version20151223125909.php @@ -19,7 +19,7 @@ public function up(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); - $schemaManager = $this->connection->getSchemaManager(); + $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_workspace']); if ($hasTables) { $workspacesWithoutOwnerQuery @@ -52,7 +52,7 @@ public function up(Schema $schema): void public function down(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); - $schemaManager = $this->connection->getSchemaManager(); + $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_workspace']); if ($hasTables) { $this->addSql('UPDATE typo3_typo3cr_domain_model_workspace SET owner = NULL'); diff --git a/Neos.Neos/Migrations/Mysql/Version20160104121311.php b/Neos.Neos/Migrations/Mysql/Version20160104121311.php index a77f6d5f328..85b45deacf5 100644 --- a/Neos.Neos/Migrations/Mysql/Version20160104121311.php +++ b/Neos.Neos/Migrations/Mysql/Version20160104121311.php @@ -19,7 +19,7 @@ public function up(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); - $schemaManager = $this->connection->getSchemaManager(); + $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_workspace']); if ($hasTables) { $workspacesWithoutOwnerQuery @@ -52,7 +52,7 @@ public function up(Schema $schema): void public function down(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); - $schemaManager = $this->connection->getSchemaManager(); + $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_workspace']); if ($hasTables) { $this->addSql('UPDATE typo3_typo3cr_domain_model_workspace SET owner = NULL'); diff --git a/Neos.Neos/Migrations/Mysql/Version20161125124749.php b/Neos.Neos/Migrations/Mysql/Version20161125124749.php index b3411173922..7f6f9e9d5d9 100644 --- a/Neos.Neos/Migrations/Mysql/Version20161125124749.php +++ b/Neos.Neos/Migrations/Mysql/Version20161125124749.php @@ -18,7 +18,7 @@ public function up(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); - $schemaManager = $this->connection->getSchemaManager(); + $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['neos_contentrepository_domain_model_nodedata']); if ($hasTables) { $this->addSql("UPDATE neos_contentrepository_domain_model_nodedata SET nodetype = REPLACE(nodetype, 'TYPO3.Neos:', 'Neos.Neos:')"); @@ -39,7 +39,7 @@ public function down(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); - $schemaManager = $this->connection->getSchemaManager(); + $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['neos_contentrepository_domain_model_nodedata']); if ($hasTables) { $this->addSql("UPDATE neos_contentrepository_domain_model_nodedata SET nodetype = REPLACE(nodetype, 'Neos.Neos:', 'TYPO3.Neos:')"); diff --git a/Neos.Neos/Migrations/Postgresql/Version20121030103851.php b/Neos.Neos/Migrations/Postgresql/Version20121030103851.php index 905406a3bee..f3c531b2e18 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20121030103851.php +++ b/Neos.Neos/Migrations/Postgresql/Version20121030103851.php @@ -25,7 +25,7 @@ public function up(Schema $schema): void $this->addSql("UPDATE typo3_party_domain_model_abstractparty SET dtype = 'typo3_neos_user' WHERE dtype = 'typo3_typo3_user'"); - $schemaManager = $this->connection->getSchemaManager(); + $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_contentobjectproxy']); if ($hasTables) { $this->addSql("UPDATE typo3_typo3cr_domain_model_contentobjectproxy SET targettype = 'TYPO3\\Neos\\Domain\\Model\\Site' WHERE targettype = 'TYPO3\\TYPO3\\Domain\\Model\\Site'"); @@ -46,7 +46,7 @@ public function down(Schema $schema): void $this->addSql("ALTER TABLE typo3_neos_domain_model_user RENAME TO typo3_typo3_domain_model_user"); $this->addSql("UPDATE typo3_party_domain_model_abstractparty SET dtype = 'typo3_typo3_user' WHERE dtype = 'typo3_neos_user'"); - $schemaManager = $this->connection->getSchemaManager(); + $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_contentobjectproxy']); if ($hasTables) { $this->addSql("UPDATE typo3_typo3cr_domain_model_contentobjectproxy SET targettype = 'TYPO3\\TYPO3\\Domain\\Model\\Site' WHERE targettype = 'TYPO3\\Neos\\Domain\\Model\\Site'"); diff --git a/Neos.Neos/Migrations/Postgresql/Version20131112191120.php b/Neos.Neos/Migrations/Postgresql/Version20131112191120.php index 719fe3a3778..c9c9b8ea795 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20131112191120.php +++ b/Neos.Neos/Migrations/Postgresql/Version20131112191120.php @@ -18,7 +18,7 @@ public function up(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); - $schemaManager = $this->connection->getSchemaManager(); + $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_nodedata']); if ($hasTables) { $this->addSql("UPDATE typo3_typo3cr_domain_model_nodedata SET contentobjectproxy = NULL, nodetype = 'TYPO3.Neos:Shortcut' WHERE parentpath = '/sites' AND nodetype = 'unstructured'"); @@ -33,7 +33,7 @@ public function down(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); - $schemaManager = $this->connection->getSchemaManager(); + $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_nodedata', 'typo3_typo3cr_domain_model_contentobjectproxy']); if ($hasTables) { $this->addSql("UPDATE typo3_typo3cr_domain_model_nodedata SET contentobjectproxy = (SELECT c.persistence_object_identifier FROM typo3_typo3cr_domain_model_contentobjectproxy AS c, typo3_neos_domain_model_site AS s WHERE c.targetid = s.persistence_object_identifier AND c.targettype = 'TYPO3\\Neos\\Domain\\Model\\Site' AND s.nodename = SUBSTRING(typo3_typo3cr_domain_model_nodedata.path, 8)), nodetype = 'unstructured' WHERE contentobjectproxy IS NULL AND parentpath = '/sites' AND nodetype = 'TYPO3.Neos:Shortcut'"); diff --git a/Neos.Neos/Migrations/Postgresql/Version20151117125552.php b/Neos.Neos/Migrations/Postgresql/Version20151117125552.php index e0d26993642..9221ff767c3 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20151117125552.php +++ b/Neos.Neos/Migrations/Postgresql/Version20151117125552.php @@ -18,7 +18,7 @@ public function up(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); - $schemaManager = $this->connection->getSchemaManager(); + $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_workspace']); if ($hasTables) { $workspacesQuery @@ -48,7 +48,7 @@ public function up(Schema $schema): void public function down(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); - $schemaManager = $this->connection->getSchemaManager(); + $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_workspace']); if ($hasTables) { $this->addSql('UPDATE typo3_typo3cr_domain_model_workspace SET owner = NULL'); diff --git a/Neos.Neos/Migrations/Postgresql/Version20151120170812.php b/Neos.Neos/Migrations/Postgresql/Version20151120170812.php index a983827821f..0ffdbea52b2 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20151120170812.php +++ b/Neos.Neos/Migrations/Postgresql/Version20151120170812.php @@ -18,7 +18,7 @@ public function up(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); - $schemaManager = $this->connection->getSchemaManager(); + $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_nodedata']); if ($hasTables) { $this->addSql("ALTER TABLE typo3_typo3cr_domain_model_nodedata ALTER dimensionvalues TYPE jsonb USING dimensionvalues::jsonb"); @@ -36,7 +36,7 @@ public function down(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); - $schemaManager = $this->connection->getSchemaManager(); + $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_nodedata']); if ($hasTables) { $this->addSql("ALTER TABLE typo3_typo3cr_domain_model_nodedata ALTER dimensionvalues TYPE JSON USING dimensionvalues::json"); diff --git a/Neos.Neos/Migrations/Postgresql/Version20151223125946.php b/Neos.Neos/Migrations/Postgresql/Version20151223125946.php index 2f4f5b84fdb..aff271d8c4f 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20151223125946.php +++ b/Neos.Neos/Migrations/Postgresql/Version20151223125946.php @@ -19,7 +19,7 @@ public function up(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); - $schemaManager = $this->connection->getSchemaManager(); + $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_workspace']); if ($hasTables) { $workspacesWithoutOwnerQuery @@ -52,7 +52,7 @@ public function up(Schema $schema): void public function down(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); - $schemaManager = $this->connection->getSchemaManager(); + $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_workspace']); if ($hasTables) { $this->addSql('UPDATE typo3_typo3cr_domain_model_workspace SET owner = NULL'); diff --git a/Neos.Neos/Migrations/Postgresql/Version20160104121413.php b/Neos.Neos/Migrations/Postgresql/Version20160104121413.php index fe7ce7228cc..1b4eb699941 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20160104121413.php +++ b/Neos.Neos/Migrations/Postgresql/Version20160104121413.php @@ -19,7 +19,7 @@ public function up(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); - $schemaManager = $this->connection->getSchemaManager(); + $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_workspace']); if ($hasTables) { $workspacesWithoutOwnerQuery @@ -52,7 +52,7 @@ public function up(Schema $schema): void public function down(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); - $schemaManager = $this->connection->getSchemaManager(); + $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_workspace']); if ($hasTables) { $this->addSql('UPDATE typo3_typo3cr_domain_model_workspace SET owner = NULL'); diff --git a/Neos.Neos/Migrations/Postgresql/Version20161125125249.php b/Neos.Neos/Migrations/Postgresql/Version20161125125249.php index 4ebc809b2c2..b1b6ad54278 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20161125125249.php +++ b/Neos.Neos/Migrations/Postgresql/Version20161125125249.php @@ -18,7 +18,7 @@ public function up(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); - $schemaManager = $this->connection->getSchemaManager(); + $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['neos_contentrepository_domain_model_nodedata']); if ($hasTables) { $this->addSql("UPDATE neos_contentrepository_domain_model_nodedata SET nodetype=REPLACE(nodetype, 'TYPO3.Neos:', 'Neos.Neos:')"); @@ -39,7 +39,7 @@ public function down(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); - $schemaManager = $this->connection->getSchemaManager(); + $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['neos_contentrepository_domain_model_nodedata']); if ($hasTables) { $this->addSql("UPDATE neos_contentrepository_domain_model_nodedata SET nodetype=REPLACE(nodetype, 'Neos.Neos:', 'TYPO3.Neos:')"); diff --git a/Neos.NodeTypes/Migrations/Mysql/Version20161125123504.php b/Neos.NodeTypes/Migrations/Mysql/Version20161125123504.php index 5c20c53b0eb..ec091880200 100644 --- a/Neos.NodeTypes/Migrations/Mysql/Version20161125123504.php +++ b/Neos.NodeTypes/Migrations/Mysql/Version20161125123504.php @@ -18,7 +18,7 @@ public function up(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); - $schemaManager = $this->connection->getSchemaManager(); + $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['neos_contentrepository_domain_model_nodedata']); if ($hasTables) { $this->addSql("UPDATE neos_contentrepository_domain_model_nodedata SET nodetype=REPLACE(nodetype, 'TYPO3.Neos.NodeTypes:', 'Neos.NodeTypes:')"); @@ -33,7 +33,7 @@ public function down(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); - $schemaManager = $this->connection->getSchemaManager(); + $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['neos_contentrepository_domain_model_nodedata']); if ($hasTables) { $this->addSql("UPDATE neos_contentrepository_domain_model_nodedata SET nodetype=REPLACE(nodetype, 'Neos.NodeTypes:', 'TYPO3.Neos.NodeTypes:')"); diff --git a/Neos.NodeTypes/Migrations/Postgresql/Version20161125125004.php b/Neos.NodeTypes/Migrations/Postgresql/Version20161125125004.php index a89cce8178a..84fd02bdc57 100644 --- a/Neos.NodeTypes/Migrations/Postgresql/Version20161125125004.php +++ b/Neos.NodeTypes/Migrations/Postgresql/Version20161125125004.php @@ -18,7 +18,7 @@ public function up(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); - $schemaManager = $this->connection->getSchemaManager(); + $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['neos_contentrepository_domain_model_nodedata']); if ($hasTables) { $this->addSql("UPDATE neos_contentrepository_domain_model_nodedata SET nodetype=REPLACE(nodetype, 'TYPO3.Neos.NodeTypes:', 'Neos.NodeTypes:')"); @@ -33,7 +33,7 @@ public function down(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); - $schemaManager = $this->connection->getSchemaManager(); + $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['neos_contentrepository_domain_model_nodedata']); if ($hasTables) { $this->addSql("UPDATE neos_contentrepository_domain_model_nodedata SET nodetype=REPLACE(nodetype, 'Neos.NodeTypes:', 'TYPO3.Neos.NodeTypes:')"); From a7ab2cdbc59320c7c5b27791e58974327eb994ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Mu=CC=88ller?= Date: Thu, 4 Jul 2024 14:35:04 +0200 Subject: [PATCH 4/8] Use Exception::getCode() to find SQL error state --- .../Classes/Infrastructure/DbalCheckpointStorage.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Neos.ContentRepository.Core/Classes/Infrastructure/DbalCheckpointStorage.php b/Neos.ContentRepository.Core/Classes/Infrastructure/DbalCheckpointStorage.php index 8cdba5c5e8c..8551d5febb8 100644 --- a/Neos.ContentRepository.Core/Classes/Infrastructure/DbalCheckpointStorage.php +++ b/Neos.ContentRepository.Core/Classes/Infrastructure/DbalCheckpointStorage.php @@ -11,7 +11,6 @@ use Doctrine\DBAL\Exception\UniqueConstraintViolationException; use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\DBAL\Platforms\PostgreSQLPlatform; -use Doctrine\DBAL\Schema\AbstractSchemaManager; use Doctrine\DBAL\Schema\Column; use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Types\Type; @@ -94,7 +93,7 @@ public function acquireLock(): SequenceNumber ]); } catch (DBALException $exception) { $this->connection->rollBack(); - if ($exception instanceof LockWaitTimeoutException) { + if ($exception instanceof LockWaitTimeoutException || ($exception instanceof DBALDriverException && ($exception->getCode() === 3572 || $exception->getCode() === 7))) { throw new \RuntimeException(sprintf('Failed to acquire checkpoint lock for subscriber "%s" because it is acquired already', $this->subscriberId), 1652279016); } throw new \RuntimeException($exception->getMessage(), 1544207778, $exception); From aac6927bb6ce0e173798d08be9d5ae6df73c450f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Mu=CC=88ller?= Date: Tue, 9 Jul 2024 23:06:07 +0200 Subject: [PATCH 5/8] Consistently use DBALException alias --- ...ectionIntegrityViolationDetectionTrait.php | 16 ++++---- .../DoctrineDbalContentGraphProjection.php | 30 +++++++------- .../DoctrineDbalContentGraphSchemaBuilder.php | 6 +-- .../Domain/Projection/Feature/NodeRemoval.php | 4 +- .../Projection/Feature/SubtreeTagging.php | 12 +++--- .../Domain/Projection/HierarchyRelation.php | 12 +++--- .../src/Domain/Projection/NodeRecord.php | 6 +-- .../ProjectionIntegrityViolationDetector.php | 40 +++++++++---------- .../src/Domain/Repository/ContentGraph.php | 8 ++-- .../src/Domain/Repository/ContentSubgraph.php | 18 ++++----- .../DimensionSpacePointsRepository.php | 6 +-- .../Repository/ProjectionContentGraph.php | 36 ++++++++--------- .../Projection/Feature/NodeVariation.php | 10 ++--- .../Projection/Workspace/WorkspaceFinder.php | 6 +-- .../Classes/Command/CrCommandController.php | 6 +-- .../Postgresql/Version20181104152204.php | 2 +- .../Projection/AssetUsageRepository.php | 4 +- .../DocumentUriPathSchemaBuilder.php | 4 +- .../Controller/WorkspaceController.php | 2 +- 19 files changed, 114 insertions(+), 114 deletions(-) diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Bootstrap/ProjectionIntegrityViolationDetectionTrait.php b/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Bootstrap/ProjectionIntegrityViolationDetectionTrait.php index 006981b11f7..a3af95d66c0 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Bootstrap/ProjectionIntegrityViolationDetectionTrait.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Bootstrap/ProjectionIntegrityViolationDetectionTrait.php @@ -16,7 +16,7 @@ use Behat\Gherkin\Node\TableNode; use Doctrine\DBAL\Connection; -use Doctrine\DBAL\Exception; +use Doctrine\DBAL\Exception as DBALException; use Doctrine\DBAL\Exception\InvalidArgumentException; use Neos\ContentGraph\DoctrineDbalAdapter\ContentGraphTableNames; use Neos\ContentGraph\DoctrineDbalAdapter\DoctrineDbalProjectionIntegrityViolationDetectionRunnerFactory; @@ -68,7 +68,7 @@ public function setupDbalGraphAdapterIntegrityViolationTrait() /** * @When /^I remove the following subtree tag:$/ * @param TableNode $payloadTable - * @throws Exception + * @throws DBALException * @throws InvalidArgumentException */ public function iRemoveTheFollowingSubtreeTag(TableNode $payloadTable): void @@ -91,7 +91,7 @@ public function iRemoveTheFollowingSubtreeTag(TableNode $payloadTable): void /** * @When /^I add the following hierarchy relation:$/ - * @throws Exception + * @throws DBALException */ public function iAddTheFollowingHierarchyRelation(TableNode $payloadTable): void { @@ -106,7 +106,7 @@ public function iAddTheFollowingHierarchyRelation(TableNode $payloadTable): void /** * @When /^I change the following hierarchy relation's dimension space point hash:$/ * @param TableNode $payloadTable - * @throws Exception + * @throws DBALException */ public function iChangeTheFollowingHierarchyRelationsDimensionSpacePointHash(TableNode $payloadTable): void { @@ -126,7 +126,7 @@ public function iChangeTheFollowingHierarchyRelationsDimensionSpacePointHash(Tab /** * @When /^I change the following node's name:$/ * @param TableNode $payloadTable - * @throws Exception + * @throws DBALException */ public function iChangeTheFollowingNodesName(TableNode $payloadTable): void { @@ -159,7 +159,7 @@ public function iChangeTheFollowingNodesName(TableNode $payloadTable): void /** * @When /^I set the following position:$/ * @param TableNode $payloadTable - * @throws Exception + * @throws DBALException */ public function iSetTheFollowingPosition(TableNode $payloadTable): void { @@ -183,7 +183,7 @@ public function iSetTheFollowingPosition(TableNode $payloadTable): void /** * @When /^I detach the following reference relation from its source:$/ * @param TableNode $payloadTable - * @throws Exception + * @throws DBALException */ public function iDetachTheFollowingReferenceRelationFromItsSource(TableNode $payloadTable): void { @@ -201,7 +201,7 @@ public function iDetachTheFollowingReferenceRelationFromItsSource(TableNode $pay /** * @When /^I set the following reference position:$/ * @param TableNode $payloadTable - * @throws Exception + * @throws DBALException */ public function iSetTheFollowingReferencePosition(TableNode $payloadTable): void { diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php index 4cd6bd12c38..07ec7c03755 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php @@ -5,7 +5,7 @@ namespace Neos\ContentGraph\DoctrineDbalAdapter; use Doctrine\DBAL\Connection; -use Doctrine\DBAL\Exception as DbalException; +use Doctrine\DBAL\Exception as DBALException; use Doctrine\DBAL\Schema\AbstractSchemaManager; use Neos\ContentGraph\DoctrineDbalAdapter\Domain\Projection\Feature\NodeMove; use Neos\ContentGraph\DoctrineDbalAdapter\Domain\Projection\Feature\NodeRemoval; @@ -94,7 +94,7 @@ public function setUp(): void foreach ($this->determineRequiredSqlStatements() as $statement) { try { $this->dbal->executeStatement($statement); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to setup projection %s: %s', self::class, $e->getMessage()), 1716478255, $e); } } @@ -228,7 +228,7 @@ private function whenContentStreamWasForked(ContentStreamWasForked $event): void $this->dbal->executeStatement($insertRelationStatement, [ 'sourceContentStreamId' => $event->sourceContentStreamId->value ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to insert hierarchy relation: %s', $e->getMessage()), 1716489211, $e); } @@ -246,7 +246,7 @@ private function whenContentStreamWasRemoved(ContentStreamWasRemoved $event): vo $this->dbal->executeStatement($deleteHierarchyRelationStatement, [ 'contentStreamId' => $event->contentStreamId->value ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to delete hierarchy relations: %s', $e->getMessage()), 1716489265, $e); } @@ -260,7 +260,7 @@ private function whenContentStreamWasRemoved(ContentStreamWasRemoved $event): vo SQL; try { $this->dbal->executeStatement($deleteNodesStatement); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to delete non-referenced nodes: %s', $e->getMessage()), 1716489294, $e); } @@ -274,7 +274,7 @@ private function whenContentStreamWasRemoved(ContentStreamWasRemoved $event): vo SQL; try { $this->dbal->executeStatement($deleteReferenceRelationsStatement); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to delete non-referenced reference relations: %s', $e->getMessage()), 1716489328, $e); } } @@ -311,7 +311,7 @@ private function whenDimensionShineThroughWasAdded(DimensionShineThroughWasAdded 'sourceDimensionSpacePointHash' => $event->source->hash, 'newDimensionSpacePointHash' => $event->target->hash, ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to insert hierarchy relations: %s', $e->getMessage()), 1716490758, $e); } } @@ -340,7 +340,7 @@ private function whenDimensionSpacePointWasMoved(DimensionSpacePointWasMoved $ev 'dimensionSpacePointHash' => $event->source->hash, 'contentStreamId' => $event->contentStreamId->value ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load relation anchor points: %s', $e->getMessage()), 1716489628, $e); } foreach ($relationAnchorPoints as $relationAnchorPoint) { @@ -369,7 +369,7 @@ function (NodeRecord $nodeRecord) use ($event) { 'newDimensionSpacePointHash' => $event->target->hash, 'contentStreamId' => $event->contentStreamId->value, ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to update hierarchy relations: %s', $e->getMessage()), 1716489951, $e); } } @@ -525,7 +525,7 @@ function (NodeRecord $node) use ($eventEnvelope) { 'nodeanchorpoint' => $nodeAnchorPoint?->value, 'name' => $event->referenceName->value ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to remove reference relation: %s', $e->getMessage()), 1716486309, $e); } @@ -549,7 +549,7 @@ function (NodeRecord $node) use ($eventEnvelope) { 'destinationnodeaggregateid' => $reference->targetNodeAggregateId->value, 'properties' => $referencePropertiesJson, ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to insert reference relation: %s', $e->getMessage()), 1716486309, $e); } $position++; @@ -590,7 +590,7 @@ private function whenRootNodeAggregateDimensionsWereUpdated(RootNodeAggregateDim 'childNodeAnchor' => $rootNodeAnchorPoint->value, 'contentStreamId' => $event->contentStreamId->value, ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to delete hierarchy relation: %s', $e->getMessage()), 1716488943, $e); } // recreate hierarchy edges for the root node @@ -658,7 +658,7 @@ private function truncateDatabaseTables(): void $this->dbal->executeQuery('TRUNCATE table ' . $this->tableNames->hierarchyRelation()); $this->dbal->executeQuery('TRUNCATE table ' . $this->tableNames->referenceRelation()); $this->dbal->executeQuery('TRUNCATE table ' . $this->tableNames->dimensionSpacePoints()); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to truncate database tables for projection %s: %s', self::class, $e->getMessage()), 1716478318, $e); } } @@ -706,7 +706,7 @@ private function updateNodeRecordWithCopyOnWrite( 'originalNodeAnchor' => $anchorPoint->value, 'contentStreamId' => $contentStreamIdWhereWriteOccurs->value, ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to update hierarchy relation: %s', $e->getMessage()), 1716486444, $e); } // reference relation rows need to be copied as well! @@ -753,7 +753,7 @@ private function copyReferenceRelations( 'sourceNodeAnchorPoint' => $sourceRelationAnchorPoint->value, 'destinationRelationAnchorPoint' => $destinationRelationAnchorPoint->value ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to copy reference relations: %s', $e->getMessage()), 1716489394, $e); } } diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphSchemaBuilder.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphSchemaBuilder.php index 1695058e1ec..155f842414f 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphSchemaBuilder.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphSchemaBuilder.php @@ -2,7 +2,7 @@ namespace Neos\ContentGraph\DoctrineDbalAdapter; -use Doctrine\DBAL\Exception as DbalException; +use Doctrine\DBAL\Exception as DBALException; use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Schema\AbstractSchemaManager; use Doctrine\DBAL\Schema\Column; @@ -111,7 +111,7 @@ private static function createTable(string $tableName, array $columns): Table { try { return new Table($tableName, $columns); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to create table "%s": %s', $tableName, $e->getMessage()), 1716490913, $e); } } @@ -120,7 +120,7 @@ private static function type(string $type): Type { try { return Type::getType($type); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to create database type "%s": %s', $type, $e->getMessage()), 1716491053, $e); } } diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/NodeRemoval.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/NodeRemoval.php index 8148f9dddae..ba50ba2a0ce 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/NodeRemoval.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/NodeRemoval.php @@ -4,7 +4,7 @@ namespace Neos\ContentGraph\DoctrineDbalAdapter\Domain\Projection\Feature; -use Doctrine\DBAL\Exception as DbalException; +use Doctrine\DBAL\Exception as DBALException; use Neos\ContentGraph\DoctrineDbalAdapter\Domain\Projection\HierarchyRelation; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; @@ -65,7 +65,7 @@ private function removeRelationRecursivelyFromDatabaseIncludingNonReferencedNode $this->dbal->executeStatement($deleteRelationsStatement, [ 'anchorPointForNode' => $ingoingRelation->childNodeAnchor->value, ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to remove relations from database: %s', $e->getMessage()), 1716473385, $e); } } diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/SubtreeTagging.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/SubtreeTagging.php index 441a695b6e1..ea7af0bb248 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/SubtreeTagging.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/SubtreeTagging.php @@ -5,7 +5,7 @@ namespace Neos\ContentGraph\DoctrineDbalAdapter\Domain\Projection\Feature; use Doctrine\DBAL\Connection; -use Doctrine\DBAL\Exception as DbalException; +use Doctrine\DBAL\Exception as DBALException; use Neos\ContentGraph\DoctrineDbalAdapter\Domain\Projection\NodeRelationAnchorPoint; use Neos\ContentGraph\DoctrineDbalAdapter\Domain\Repository\NodeFactory; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint; @@ -60,7 +60,7 @@ private function addSubtreeTag(ContentStreamId $contentStreamId, NodeAggregateId ], [ 'dimensionSpacePointHashes' => Connection::PARAM_STR_ARRAY, ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to add subtree tag %s for content stream %s, node aggregate id %s and dimension space points %s: %s', $tag->value, $contentStreamId->value, $nodeAggregateId->value, $affectedDimensionSpacePoints->toJson(), $e->getMessage()), 1716479749, $e); } @@ -82,7 +82,7 @@ private function addSubtreeTag(ContentStreamId $contentStreamId, NodeAggregateId ], [ 'dimensionSpacePointHashes' => Connection::PARAM_STR_ARRAY, ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to add subtree tag %s for content stream %s, node aggregate id %s and dimension space points %s: %s', $tag->value, $contentStreamId->value, $nodeAggregateId->value, $affectedDimensionSpacePoints->toJson(), $e->getMessage()), 1716479840, $e); } } @@ -137,7 +137,7 @@ private function removeSubtreeTag(ContentStreamId $contentStreamId, NodeAggregat ], [ 'dimensionSpacePointHashes' => Connection::PARAM_STR_ARRAY, ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to remove subtree tag %s for content stream %s, node aggregate id %s and dimension space points %s: %s', $tag->value, $contentStreamId->value, $nodeAggregateId->value, $affectedDimensionSpacePoints->toJson(), $e->getMessage()), 1716482293, $e); } } @@ -197,7 +197,7 @@ private function moveSubtreeTags(ContentStreamId $contentStreamId, NodeAggregate 'newParentNodeAggregateId' => $newParentNodeAggregateId->value, 'dimensionSpacePointHash' => $coveredDimensionSpacePoint->hash, ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to move subtree tags for content stream %s, new parent node aggregate id %s and dimension space point %s: %s', $contentStreamId->value, $newParentNodeAggregateId->value, $coveredDimensionSpacePoint->toJson(), $e->getMessage()), 1716482574, $e); } } @@ -219,7 +219,7 @@ private function subtreeTagsForHierarchyRelation(ContentStreamId $contentStreamI 'contentStreamId' => $contentStreamId->value, 'dimensionSpacePointHash' => $dimensionSpacePoint->hash, ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to fetch subtree tags for hierarchy parent anchor point "%s" in content subgraph "%s@%s": %s', $parentNodeAnchorPoint->value, $dimensionSpacePoint->toJson(), $contentStreamId->value, $e->getMessage()), 1716478760, $e); } if (!is_string($subtreeTagsJson)) { diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/HierarchyRelation.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/HierarchyRelation.php index 45d2150aac1..0b34a8249e1 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/HierarchyRelation.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/HierarchyRelation.php @@ -15,7 +15,7 @@ namespace Neos\ContentGraph\DoctrineDbalAdapter\Domain\Projection; use Doctrine\DBAL\Connection; -use Doctrine\DBAL\Exception as DbalException; +use Doctrine\DBAL\Exception as DBALException; use Neos\ContentGraph\DoctrineDbalAdapter\ContentGraphTableNames; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint; use Neos\ContentGraph\DoctrineDbalAdapter\Domain\Repository\DimensionSpacePointsRepository; @@ -59,7 +59,7 @@ public function addToDatabase(Connection $databaseConnection, ContentGraphTableN 'position' => $this->position, 'subtreetags' => $subtreeTagsJson, ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to add hierarchy relation to database: %s', $e->getMessage()), 1716484789, $e); } } @@ -68,7 +68,7 @@ public function removeFromDatabase(Connection $databaseConnection, ContentGraphT { try { $databaseConnection->delete($tableNames->hierarchyRelation(), $this->getDatabaseId()); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to remove hierarchy relation from database: %s', $e->getMessage()), 1716484823, $e); } } @@ -86,7 +86,7 @@ public function assignNewChildNode( ], $this->getDatabaseId() ); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to update hierarchy relation: %s', $e->getMessage()), 1716484843, $e); } } @@ -109,7 +109,7 @@ public function assignNewParentNode( $data, $this->getDatabaseId() ); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to update hierarchy relation: %s', $e->getMessage()), 1716478609, $e); } } @@ -124,7 +124,7 @@ public function assignNewPosition(int $position, Connection $databaseConnection, ], $this->getDatabaseId() ); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to update hierarchy relation: %s', $e->getMessage()), 1716485014, $e); } } diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/NodeRecord.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/NodeRecord.php index 44cff0abae5..0b8b7398f5e 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/NodeRecord.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/NodeRecord.php @@ -15,7 +15,7 @@ namespace Neos\ContentGraph\DoctrineDbalAdapter\Domain\Projection; use Doctrine\DBAL\Connection; -use Doctrine\DBAL\Exception as DbalException; +use Doctrine\DBAL\Exception as DBALException; use Doctrine\DBAL\Types\Types; use Neos\ContentGraph\DoctrineDbalAdapter\ContentGraphTableNames; use Neos\ContentGraph\DoctrineDbalAdapter\Domain\Repository\DimensionSpacePointsRepository; @@ -75,7 +75,7 @@ public function updateToDatabase(Connection $databaseConnection, ContentGraphTab 'originallastmodified' => Types::DATETIME_IMMUTABLE, ] ); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to update node in database: %s', $e->getMessage()), 1716473799, $e); } } @@ -157,7 +157,7 @@ public static function createNewInDatabase( 'lastmodified' => Types::DATETIME_IMMUTABLE, 'originallastmodified' => Types::DATETIME_IMMUTABLE, ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to add node to database: %s', $e->getMessage()), 1716473919, $e); } diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/ProjectionIntegrityViolationDetector.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/ProjectionIntegrityViolationDetector.php index 221b3cac246..2d80a8c6537 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/ProjectionIntegrityViolationDetector.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/ProjectionIntegrityViolationDetector.php @@ -15,7 +15,7 @@ namespace Neos\ContentGraph\DoctrineDbalAdapter\Domain\Projection; use Doctrine\DBAL\Connection; -use Doctrine\DBAL\Exception as DbalException; +use Doctrine\DBAL\Exception as DBALException; use Neos\ContentGraph\DoctrineDbalAdapter\ContentGraphTableNames; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet; @@ -56,7 +56,7 @@ public function hierarchyIntegrityIsProvided(): Result $disconnectedHierarchyRelationRecords = $this->dbal->executeQuery($disconnectedHierarchyRelationStatement, [ 'rootNodeAnchor' => NodeRelationAnchorPoint::forRootEdge()->value ])->fetchAllAssociative(); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load disconnected hierarchy relations: %s', $e->getMessage()), 1716491735, $e); } @@ -78,7 +78,7 @@ public function hierarchyIntegrityIsProvided(): Result SQL; try { $invalidlyHashedHierarchyRelationRecords = $this->dbal->fetchAllAssociative($invalidlyHashedHierarchyRelationStatement); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load invalid hashed hierarchy relations: %s', $e->getMessage()), 1716491994, $e); } @@ -107,7 +107,7 @@ public function hierarchyIntegrityIsProvided(): Result $hierarchyRelationRecordsAppearingMultipleTimes = $this->dbal->fetchAllAssociative($hierarchyRelationsAppearingMultipleTimesStatement, [ 'rootNodeAnchor' => NodeRelationAnchorPoint::forRootEdge()->value ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load hierarchy relations that appear multiple times: %s', $e->getMessage()), 1716495277, $e); } foreach ($hierarchyRelationRecordsAppearingMultipleTimes as $record) { @@ -141,7 +141,7 @@ public function siblingsAreDistinctlySorted(): Result SQL; try { $ambiguouslySortedHierarchyRelationRecords = $this->dbal->executeQuery($ambiguouslySortedHierarchyRelationStatement); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load ambiguously sorted hierarchy relations: %s', $e->getMessage()), 1716492251, $e); } if ($ambiguouslySortedHierarchyRelationRecords->columnCount() === 0) { @@ -160,7 +160,7 @@ public function siblingsAreDistinctlySorted(): Result $ambiguouslySortedNodeRecords = $this->dbal->fetchAllAssociative($ambiguouslySortedNodesStatement, [ 'relationAnchorPoint' => $hierarchyRelationRecord['childnodeanchor'] ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load ambiguously sorted nodes: %s', $e->getMessage()), 1716492358, $e); } @@ -194,7 +194,7 @@ public function tetheredNodesAreNamed(): Result $unnamedTetheredNodeRecords = $this->dbal->fetchAllAssociative($unnamedTetheredNodesStatement, [ 'tethered' => NodeAggregateClassification::CLASSIFICATION_TETHERED->value ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load unnamed tethered nodes: %s', $e->getMessage()), 1716492549, $e); } @@ -232,7 +232,7 @@ public function subtreeTagsAreInherited(): Result SQL; try { $hierarchyRelationsWithMissingSubtreeTags = $this->dbal->fetchAllAssociative($hierarchyRelationsWithMissingSubtreeTagsStatement); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load hierarchy relations with missing subtree tags: %s', $e->getMessage()), 1716492658, $e); } @@ -263,7 +263,7 @@ public function referenceIntegrityIsProvided(): Result SQL; try { $referenceRelationRecordsDetachedFromSource = $this->dbal->fetchAllAssociative($referenceRelationRecordsDetachedFromSourceStatement); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load detached reference relations: %s', $e->getMessage()), 1716492786, $e); } @@ -297,7 +297,7 @@ public function referenceIntegrityIsProvided(): Result SQL; try { $referenceRelationRecordsWithInvalidTarget = $this->dbal->fetchAllAssociative($referenceRelationRecordsWithInvalidTargetStatement); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load reference relations with invalid target: %s', $e->getMessage()), 1716492909, $e); } @@ -368,7 +368,7 @@ public function allNodesAreConnectedToARootNodePerSubgraph(): Result 'contentStreamId' => $contentStreamId->value, 'dimensionSpacePointHash' => $dimensionSpacePoint->hash ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load cyclic node relations: %s', $e->getMessage()), 1716493090, $e); } @@ -423,7 +423,7 @@ public function nodeAggregateIdsAreUniquePerSubgraph(): Result 'contentStreamId' => $contentStreamId->value, 'dimensionSpacePointHash' => $dimensionSpacePoint->hash ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load ambiguous node aggregates: %s', $e->getMessage()), 1716494110, $e); } foreach ($ambiguousNodeAggregateRecords as $ambiguousRecord) { @@ -465,7 +465,7 @@ public function allNodesHaveAtMostOneParentPerSubgraph(): Result 'contentStreamId' => $contentStreamId->value, 'dimensionSpacePointHash' => $dimensionSpacePoint->hash ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load nodes with multiple parents: %s', $e->getMessage()), 1716494223, $e); } @@ -507,7 +507,7 @@ public function nodeAggregatesAreConsistentlyTypedPerContentStream(): Result 'contentStreamId' => $contentStreamId->value, 'nodeAggregateId' => $nodeAggregateId->value ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load node type names: %s', $e->getMessage()), 1716494446, $e); } @@ -549,7 +549,7 @@ public function nodeAggregatesAreConsistentlyClassifiedPerContentStream(): Resul 'contentStreamId' => $contentStreamId->value, 'nodeAggregateId' => $nodeAggregateId->value ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load node classifications: %s', $e->getMessage()), 1716494466, $e); } @@ -588,7 +588,7 @@ public function childNodeCoverageIsASubsetOfParentNodeCoverage(): Result $excessivelyCoveringNodeRecords = $this->dbal->fetchAllAssociative($excessivelyCoveringStatement, [ 'contentStreamId' => $contentStreamId->value ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load excessively covering nodes: %s', $e->getMessage()), 1716494618, $e); } foreach ($excessivelyCoveringNodeRecords as $excessivelyCoveringNodeRecord) { @@ -636,7 +636,7 @@ public function allNodesCoverTheirOrigin(): Result 'contentStreamId' => $contentStreamId->value, 'rootClassification' => NodeAggregateClassification::CLASSIFICATION_ROOT->value ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load nodes with missing origin coverage: %s', $e->getMessage()), 1716494752, $e); } @@ -666,7 +666,7 @@ private function findProjectedContentStreamIds(): iterable SQL; try { $contentStreamIds = $this->dbal->fetchFirstColumn($contentStreamIdsStatement); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load content stream ids: %s', $e->getMessage()), 1716494814, $e); } return array_map(ContentStreamId::fromString(...), $contentStreamIds); @@ -682,7 +682,7 @@ private function findProjectedDimensionSpacePoints(): DimensionSpacePointSet SQL; try { $dimensionSpacePoints = $this->dbal->fetchFirstColumn($dimensionSpacePointsStatement); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load dimension space points: %s', $e->getMessage()), 1716494888, $e); } return new DimensionSpacePointSet(array_map(DimensionSpacePoint::fromJsonString(...), $dimensionSpacePoints)); @@ -707,7 +707,7 @@ protected function findProjectedNodeAggregateIdsInContentStream( $nodeAggregateIds = $this->dbal->fetchFirstColumn($nodeAggregateIdsStatement, [ 'contentStreamId' => $contentStreamId->value, ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load node aggregate ids for content stream: %s', $e->getMessage()), 1716495988, $e); } return array_map(NodeAggregateId::fromString(...), $nodeAggregateIds); diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php index 3fffda3eeef..cc61e1c78d8 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php @@ -16,7 +16,7 @@ use Doctrine\DBAL\Connection; use Doctrine\DBAL\Driver\Exception as DriverException; -use Doctrine\DBAL\Exception as DbalException; +use Doctrine\DBAL\Exception as DBALException; use Doctrine\DBAL\Query\QueryBuilder; use Doctrine\DBAL\Result; use Neos\ContentGraph\DoctrineDbalAdapter\ContentGraphTableNames; @@ -313,7 +313,7 @@ public function countNodes(): int throw new \RuntimeException(sprintf('Failed to count nodes. Expected result to be of type %s, got: %s', Result::class, get_debug_type($result)), 1701444550); } return (int)$result->fetchOne(); - } catch (DriverException | DbalException $e) { + } catch (DriverException | DBALException $e) { throw new \RuntimeException(sprintf('Failed to count rows in database: %s', $e->getMessage()), 1701444590, $e); } } @@ -343,7 +343,7 @@ private function mapQueryBuilderToNodeAggregate(QueryBuilder $queryBuilder): ?No /** * @param QueryBuilder $queryBuilder - * @return \Traversable + * @return NodeAggregates */ private function mapQueryBuilderToNodeAggregates(QueryBuilder $queryBuilder): NodeAggregates { @@ -366,7 +366,7 @@ private function fetchRows(QueryBuilder $queryBuilder): array throw new \RuntimeException(sprintf('Failed to execute query. Expected result to be of type %s, got: %s', Result::class, get_debug_type($result)), 1701443535); } return $result->fetchAllAssociative(); - } catch (DriverException | DbalException $e) { + } catch (DriverException | DBALException $e) { throw new \RuntimeException(sprintf('Failed to fetch rows from database: %s', $e->getMessage()), 1701444358, $e); } } diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php index 49e0fb5faaf..982b43cd6ed 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php @@ -15,7 +15,7 @@ namespace Neos\ContentGraph\DoctrineDbalAdapter\Domain\Repository; use Doctrine\DBAL\Connection; -use Doctrine\DBAL\Exception as DbalException; +use Doctrine\DBAL\Exception as DBALException; use Doctrine\DBAL\Query\QueryBuilder; use Doctrine\DBAL\Result; use Neos\ContentGraph\DoctrineDbalAdapter\ContentGraphTableNames; @@ -424,7 +424,7 @@ public function countNodes(): int $queryBuilder = $this->nodeQueryBuilder->buildBasicNodeQuery($this->contentStreamId, $this->dimensionSpacePoint, 'n', 'COUNT(*)'); try { $result = $this->executeQuery($queryBuilder)->fetchOne(); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to count all nodes: %s', $e->getMessage()), 1678364741, $e); } @@ -659,7 +659,7 @@ private function applyPagination(QueryBuilder $queryBuilder, Pagination $paginat /** * @param QueryBuilder $queryBuilder * @return Result - * @throws DbalException + * @throws DBALException */ private function executeQuery(QueryBuilder $queryBuilder): Result { @@ -670,7 +670,7 @@ private function fetchNode(QueryBuilder $queryBuilder): ?Node { try { $nodeRow = $this->executeQuery($queryBuilder)->fetchAssociative(); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to fetch node: %s', $e->getMessage()), 1678286030, $e); } if ($nodeRow === false) { @@ -689,7 +689,7 @@ private function fetchNodes(QueryBuilder $queryBuilder): Nodes { try { $nodeRows = $this->executeQuery($queryBuilder)->fetchAllAssociative(); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to fetch nodes: %s', $e->getMessage()), 1678292896, $e); } return $this->nodeFactory->mapNodeRowsToNodes( @@ -705,7 +705,7 @@ private function fetchCount(QueryBuilder $queryBuilder): int { try { return (int)$this->executeQuery($queryBuilder->select('COUNT(*)')->resetQueryPart('orderBy')->setFirstResult(0)->setMaxResults(1))->fetchOne(); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to fetch count: %s', $e->getMessage()), 1679048349, $e); } } @@ -714,7 +714,7 @@ private function fetchReferences(QueryBuilder $queryBuilder): References { try { $referenceRows = $this->executeQuery($queryBuilder)->fetchAllAssociative(); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to fetch references: %s', $e->getMessage()), 1678364944, $e); } return $this->nodeFactory->mapReferenceRowsToReferences($referenceRows, $this->workspaceName, $this->contentStreamId, $this->dimensionSpacePoint, $this->visibilityConstraints); @@ -737,7 +737,7 @@ private function fetchCteResults(QueryBuilder $queryBuilderInitial, QueryBuilder $parameterTypes = array_merge($queryBuilderInitial->getParameterTypes(), $queryBuilderRecursive->getParameterTypes(), $queryBuilderCte->getParameterTypes()); try { return $this->dbal->fetchAllAssociative($query, $parameters, $parameterTypes); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to fetch CTE result: %s', $e->getMessage()), 1678358108, $e); } } @@ -756,7 +756,7 @@ private function fetchCteCountResult(QueryBuilder $queryBuilderInitial, QueryBui $parameterTypes = array_merge($queryBuilderInitial->getParameterTypes(), $queryBuilderRecursive->getParameterTypes(), $queryBuilderCte->getParameterTypes()); try { return (int)$this->dbal->fetchOne($query, $parameters, $parameterTypes); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to fetch CTE count result: %s', $e->getMessage()), 1679047841, $e); } } diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/DimensionSpacePointsRepository.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/DimensionSpacePointsRepository.php index cfaeb9b026c..4390c6ff7a8 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/DimensionSpacePointsRepository.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/DimensionSpacePointsRepository.php @@ -15,7 +15,7 @@ namespace Neos\ContentGraph\DoctrineDbalAdapter\Domain\Repository; use Doctrine\DBAL\Connection; -use Doctrine\DBAL\Exception as DbalException; +use Doctrine\DBAL\Exception as DBALException; use Neos\ContentGraph\DoctrineDbalAdapter\ContentGraphTableNames; use Neos\ContentRepository\Core\DimensionSpace\AbstractDimensionSpacePoint; use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint; @@ -91,7 +91,7 @@ private function writeDimensionSpacePoint(string $hash, string $dimensionSpacePo 'dimensionspacepoint' => $dimensionSpacePointCoordinatesJson ] ); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to insert dimension space point to database: %s', $e->getMessage()), 1716474073, $e); } } @@ -108,7 +108,7 @@ private function fillRuntimeCacheFromDatabase(): void SQL; try { $allDimensionSpacePoints = $this->dbal->fetchAllAssociative($allDimensionSpacePointsStatement); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load dimension space points from database: %s', $e->getMessage()), 1716488678, $e); } foreach ($allDimensionSpacePoints as $dimensionSpacePointRow) { diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ProjectionContentGraph.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ProjectionContentGraph.php index 02b1e7c2bb8..05f09b9a435 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ProjectionContentGraph.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ProjectionContentGraph.php @@ -15,7 +15,7 @@ namespace Neos\ContentGraph\DoctrineDbalAdapter\Domain\Repository; use Doctrine\DBAL\Connection; -use Doctrine\DBAL\Exception as DbalException; +use Doctrine\DBAL\Exception as DBALException; use Neos\ContentGraph\DoctrineDbalAdapter\ContentGraphTableNames; use Neos\ContentGraph\DoctrineDbalAdapter\DoctrineDbalContentGraphProjection; use Neos\ContentGraph\DoctrineDbalAdapter\Domain\Projection\HierarchyRelation; @@ -79,7 +79,7 @@ public function findParentNode( 'originDimensionSpacePointHash' => $originDimensionSpacePoint->hash, 'coveredDimensionSpacePointHash' => $coveredDimensionSpacePoint->hash ?? $originDimensionSpacePoint->hash ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load parent node for content stream %s, child node aggregate id %s, origin dimension space point %s from database: %s', $contentStreamId->value, $childNodeAggregateId->value, $originDimensionSpacePoint->toJson(), $e->getMessage()), 1716475976, $e); } @@ -109,7 +109,7 @@ public function findNodeInAggregate( 'nodeAggregateId' => $nodeAggregateId->value, 'dimensionSpacePointHash' => $coveredDimensionSpacePoint->hash ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load node for content stream %s, aggregate id %s and covered dimension space point %s from database: %s', $contentStreamId->value, $nodeAggregateId->value, $coveredDimensionSpacePoint->toJson(), $e->getMessage()), 1716474165, $e); } @@ -138,7 +138,7 @@ public function getAnchorPointForNodeAndOriginDimensionSpacePointAndContentStrea 'originDimensionSpacePointHash' => $originDimensionSpacePoint->hash, 'contentStreamId' => $contentStreamId->value, ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load node anchor points for content stream %s, node aggregate %s and origin dimension space point %s from database: %s', $contentStreamId->value, $nodeAggregateId->value, $originDimensionSpacePoint->toJson(), $e->getMessage()), 1716474224, $e); } @@ -170,7 +170,7 @@ public function getAnchorPointsForNodeAggregateInContentStream( 'nodeAggregateId' => $nodeAggregateId->value, 'contentStreamId' => $contentStreamId->value, ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load node anchor points for content stream %s and node aggregate id %s from database: %s', $contentStreamId->value, $nodeAggregateId->value, $e->getMessage()), 1716474706, $e); } @@ -192,7 +192,7 @@ public function getNodeByAnchorPoint(NodeRelationAnchorPoint $nodeRelationAnchor $nodeRow = $this->dbal->fetchAssociative($nodeByAnchorPointStatement, [ 'relationAnchorPoint' => $nodeRelationAnchorPoint->value, ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load node for anchor point %s from database: %s', $nodeRelationAnchorPoint->value, $e->getMessage()), 1716474765, $e); } @@ -230,7 +230,7 @@ public function determineHierarchyRelationPosition( 'contentStreamId' => $contentStreamId->value, 'dimensionSpacePointHash' => $dimensionSpacePoint->hash ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load succeeding sibling relations for content stream %s, anchor point %s and dimension space point %s from database: %s', $contentStreamId->value, $succeedingSiblingAnchorPoint->value, $dimensionSpacePoint->toJson(), $e->getMessage()), 1716474854, $e); } @@ -255,7 +255,7 @@ public function determineHierarchyRelationPosition( 'dimensionSpacePointHash' => $dimensionSpacePoint->hash, 'position' => $succeedingSiblingPosition ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load preceding sibling relations for content stream %s, anchor point %s and dimension space point %s from database: %s', $contentStreamId->value, $parentAnchorPoint->value, $dimensionSpacePoint->toJson(), $e->getMessage()), 1716474957, $e); } $precedingSiblingPosition = $precedingSiblingData ? ($precedingSiblingData['position'] ?? null) : null; @@ -287,7 +287,7 @@ public function determineHierarchyRelationPosition( 'contentStreamId' => $contentStreamId->value, 'dimensionSpacePointHash' => $dimensionSpacePoint->hash ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load child hierarchy relation for content stream %s, anchor point %s and dimension space point %s from database: %s', $contentStreamId->value, $childAnchorPoint->value, $dimensionSpacePoint->toJson(), $e->getMessage()), 1716475001, $e); } $parentAnchorPoint = NodeRelationAnchorPoint::fromInteger( @@ -310,7 +310,7 @@ public function determineHierarchyRelationPosition( 'contentStreamId' => $contentStreamId->value, 'dimensionSpacePointHash' => $dimensionSpacePoint->hash ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to right most succeeding relation for content stream %s, anchor point %s and dimension space point %s from database: %s', $contentStreamId->value, $parentAnchorPoint->value, $dimensionSpacePoint->toJson(), $e->getMessage()), 1716475046, $e); } @@ -349,7 +349,7 @@ public function getOutgoingHierarchyRelationsForNodeAndSubgraph( 'contentStreamId' => $contentStreamId->value, 'dimensionSpacePointHash' => $dimensionSpacePoint->hash ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load outgoing hierarchy relations for content stream %s, parent anchor point %s and dimension space point %s from database: %s', $contentStreamId->value, $parentAnchorPoint->value, $dimensionSpacePoint->toJson(), $e->getMessage()), 1716475151, $e); } return array_map($this->mapRawDataToHierarchyRelation(...), $rows); @@ -379,7 +379,7 @@ public function getIngoingHierarchyRelationsForNodeAndSubgraph( 'contentStreamId' => $contentStreamId->value, 'dimensionSpacePointHash' => $dimensionSpacePoint->hash ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load ingoing hierarchy relations for content stream %s, child anchor point %s and dimension space point %s from database: %s', $contentStreamId->value, $childAnchorPoint->value, $dimensionSpacePoint->toJson(), $e->getMessage()), 1716475151, $e); } return array_map($this->mapRawDataToHierarchyRelation(...), $rows); @@ -415,7 +415,7 @@ public function findIngoingHierarchyRelationsForNode( } try { $rows = $this->dbal->fetchAllAssociative($ingoingHierarchyRelationsStatement, $parameters, $types); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load ingoing hierarchy relations for content stream %s, child anchor point %s and dimension space points %s from database: %s', $contentStreamId->value, $childAnchorPoint->value, $restrictToSet?->toJson() ?? '[any]', $e->getMessage()), 1716476299, $e); } $relations = []; @@ -455,7 +455,7 @@ public function findOutgoingHierarchyRelationsForNode( } try { $rows = $this->dbal->fetchAllAssociative($outgoingHierarchyRelationsStatement, $parameters, $types); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load outgoing hierarchy relations for content stream %s, parent anchor point %s and dimension space points %s from database: %s', $contentStreamId->value, $parentAnchorPoint->value, $restrictToSet?->toJson() ?? '[any]', $e->getMessage()), 1716476573, $e); } $relations = []; @@ -492,7 +492,7 @@ public function findOutgoingHierarchyRelationsForNodeAggregate( ], [ 'dimensionSpacePointHashes' => Connection::PARAM_STR_ARRAY ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load outgoing hierarchy relations for content stream %s, node aggregate id %s and dimension space points %s from database: %s', $contentStreamId->value, $nodeAggregateId->value, $dimensionSpacePointSet->toJson(), $e->getMessage()), 1716476690, $e); } return array_map($this->mapRawDataToHierarchyRelation(...), $rows); @@ -528,7 +528,7 @@ public function findIngoingHierarchyRelationsForNodeAggregate( } try { $rows = $this->dbal->fetchAllAssociative($ingoingHierarchyRelationsStatement, $parameters, $types); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load ingoing hierarchy relations for content stream %s, node aggregate id %s and dimension space points %s from database: %s', $contentStreamId->value, $nodeAggregateId->value, $dimensionSpacePointSet?->toJson() ?? '[any]', $e->getMessage()), 1716476743, $e); } return array_map($this->mapRawDataToHierarchyRelation(...), $rows); @@ -552,7 +552,7 @@ public function getAllContentStreamIdsAnchorPointIsContainedIn( $contentStreamIds = $this->dbal->fetchFirstColumn($contentStreamIdsStatement, [ 'nodeRelationAnchorPoint' => $nodeRelationAnchorPoint->value, ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load content stream ids for relation anchor point %s from database: %s', $nodeRelationAnchorPoint->value, $e->getMessage()), 1716478504, $e); } return array_map(ContentStreamId::fromString(...), $contentStreamIds); @@ -575,7 +575,7 @@ private function mapRawDataToHierarchyRelation(array $rawData): HierarchyRelatio $dimensionSpacePointJson = $this->dbal->fetchOne($dimensionSpacePointStatement, [ 'hash' => $rawData['dimensionspacepointhash'] ]); - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load dimension space point for hash %s from database: %s', $rawData['dimensionspacepointhash'], $e->getMessage()), 1716476830, $e); } diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Feature/NodeVariation.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Feature/NodeVariation.php index 58bc70dbf37..11d687180f3 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Feature/NodeVariation.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Feature/NodeVariation.php @@ -15,7 +15,7 @@ namespace Neos\ContentGraph\PostgreSQLAdapter\Domain\Projection\Feature; use Doctrine\DBAL\Connection; -use Doctrine\DBAL\Exception as DbalException; +use Doctrine\DBAL\Exception as DBALException; use Neos\ContentGraph\PostgreSQLAdapter\Domain\Projection\EventCouldNotBeAppliedToContentGraph; use Neos\ContentGraph\PostgreSQLAdapter\Domain\Projection\HierarchyHyperrelationRecord; use Neos\ContentGraph\PostgreSQLAdapter\Domain\Projection\NodeRecord; @@ -198,7 +198,7 @@ private function whenNodePeerVariantWasCreated(NodePeerVariantWasCreated $event) } /** - * @throws DbalException + * @throws DBALException */ protected function copyNodeToOriginDimensionSpacePoint( NodeRecord $sourceNode, @@ -220,7 +220,7 @@ protected function copyNodeToOriginDimensionSpacePoint( } /** - * @throws DbalException + * @throws DBALException */ protected function replaceNodeRelationAnchorPoint( ContentStreamId $contentStreamId, @@ -347,7 +347,7 @@ protected function addMissingHierarchyRelations( } /** - * @throws DbalException + * @throws DBALException */ protected function assignNewChildNodeToAffectedHierarchyRelations( ContentStreamId $contentStreamId, @@ -372,7 +372,7 @@ protected function assignNewChildNodeToAffectedHierarchyRelations( } /** - * @throws DbalException + * @throws DBALException */ protected function assignNewParentNodeToAffectedHierarchyRelations( ContentStreamId $contentStreamId, diff --git a/Neos.ContentRepository.Core/Classes/Projection/Workspace/WorkspaceFinder.php b/Neos.ContentRepository.Core/Classes/Projection/Workspace/WorkspaceFinder.php index ebaf7f3993a..bd87127f8d7 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/Workspace/WorkspaceFinder.php +++ b/Neos.ContentRepository.Core/Classes/Projection/Workspace/WorkspaceFinder.php @@ -15,7 +15,7 @@ namespace Neos\ContentRepository\Core\Projection\Workspace; use Doctrine\DBAL\Connection; -use Doctrine\DBAL\Exception as DbalException; +use Doctrine\DBAL\Exception as DBALException; use Neos\ContentRepository\Core\Projection\ProjectionStateInterface; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceDescription; @@ -92,7 +92,7 @@ public function findOneByCurrentContentStreamId( /** * @return array - * @throws DbalException + * @throws DBALException */ public function findByBaseWorkspace(WorkspaceName $baseWorkspace): array { @@ -156,7 +156,7 @@ public function findAll(): Workspaces /** * @return array * @throws \Doctrine\DBAL\Driver\Exception - * @throws DbalException + * @throws DBALException */ public function findOutdated(): array { diff --git a/Neos.ContentRepository.LegacyNodeMigration/Classes/Command/CrCommandController.php b/Neos.ContentRepository.LegacyNodeMigration/Classes/Command/CrCommandController.php index 31ceaea585d..337a3aa66ce 100644 --- a/Neos.ContentRepository.LegacyNodeMigration/Classes/Command/CrCommandController.php +++ b/Neos.ContentRepository.LegacyNodeMigration/Classes/Command/CrCommandController.php @@ -16,7 +16,7 @@ use Doctrine\DBAL\Configuration; use Doctrine\DBAL\Connection; use Doctrine\DBAL\DriverManager; -use Doctrine\DBAL\Exception as DbalException; +use Doctrine\DBAL\Exception as DBALException; use Doctrine\DBAL\Exception\ConnectionException; use Neos\ContentRepository\Core\Projection\CatchUpOptions; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; @@ -70,7 +70,7 @@ public function migrateLegacyDataCommand(bool $verbose = false, string $config = $resourcesPath = $parsedConfig['resourcesPath'] ?? self::defaultResourcesPath(); try { $connection = isset($parsedConfig['dbal']) ? DriverManager::getConnection(array_merge($this->connection->getParams(), $parsedConfig['dbal']), new Configuration()) : $this->connection; - } catch (DbalException $e) { + } catch (DBALException $e) { throw new \InvalidArgumentException(sprintf('Failed to get database connection, check the --config parameter: %s', $e->getMessage()), 1659527201, $e); } } else { @@ -152,7 +152,7 @@ public function migrateLegacyDataCommand(bool $verbose = false, string $config = } /** - * @throws DbalException + * @throws DBALException */ private function adjustDataBaseConnection(Connection $connection): Connection { diff --git a/Neos.Media/Migrations/Postgresql/Version20181104152204.php b/Neos.Media/Migrations/Postgresql/Version20181104152204.php index abfb787187e..408cd1d9224 100644 --- a/Neos.Media/Migrations/Postgresql/Version20181104152204.php +++ b/Neos.Media/Migrations/Postgresql/Version20181104152204.php @@ -11,7 +11,7 @@ * source code. */ -use Doctrine\DBAL\Exception as DbalException; +use Doctrine\DBAL\Exception as DBALException; use Doctrine\Migrations\Exception\AbortMigration as AbortMigrationException; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; diff --git a/Neos.Neos/Classes/AssetUsage/Projection/AssetUsageRepository.php b/Neos.Neos/Classes/AssetUsage/Projection/AssetUsageRepository.php index 1760fb5c1e1..e650fe81daf 100644 --- a/Neos.Neos/Classes/AssetUsage/Projection/AssetUsageRepository.php +++ b/Neos.Neos/Classes/AssetUsage/Projection/AssetUsageRepository.php @@ -5,7 +5,7 @@ namespace Neos\Neos\AssetUsage\Projection; use Doctrine\DBAL\Connection; -use Doctrine\DBAL\Exception as DbalException; +use Doctrine\DBAL\Exception as DBALException; use Doctrine\DBAL\Exception\UniqueConstraintViolationException; use Doctrine\DBAL\Result; use Doctrine\DBAL\Platforms\AbstractPlatform; @@ -260,7 +260,7 @@ public function removeNode( } /** - * @throws DbalException + * @throws DBALException */ public function reset(): void { diff --git a/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathSchemaBuilder.php b/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathSchemaBuilder.php index 69fdfccf2f6..8a4e755e8a9 100644 --- a/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathSchemaBuilder.php +++ b/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathSchemaBuilder.php @@ -2,7 +2,7 @@ namespace Neos\Neos\FrontendRouting\Projection; -use Doctrine\DBAL\Exception as DbalException; +use Doctrine\DBAL\Exception as DBALException; use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Schema\AbstractSchemaManager; use Doctrine\DBAL\Schema\Column; @@ -25,7 +25,7 @@ public function __construct( /** * @param AbstractSchemaManager $schemaManager * @return Schema - * @throws DbalException + * @throws DBALException * @throws SchemaException */ public function buildSchema(AbstractSchemaManager $schemaManager): Schema diff --git a/Neos.Workspace.Ui/Classes/Controller/WorkspaceController.php b/Neos.Workspace.Ui/Classes/Controller/WorkspaceController.php index 621b11e3fd4..3c2a6d93d14 100644 --- a/Neos.Workspace.Ui/Classes/Controller/WorkspaceController.php +++ b/Neos.Workspace.Ui/Classes/Controller/WorkspaceController.php @@ -351,7 +351,7 @@ public function updateAction( * @throws IndexOutOfBoundsException * @throws InvalidFormatPlaceholderException * @throws StopActionException - * @throws DbalException + * @throws DBALException */ public function deleteAction(WorkspaceName $workspaceName): void { From 8cb5fb3b950d02345a44bd25dfa3cac62abae4cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Mu=CC=88ller?= Date: Tue, 9 Jul 2024 23:50:07 +0200 Subject: [PATCH 6/8] Cleanup platform getName() in migrations --- .../Migrations/Mysql/Version20110925123120.php | 11 ++++++----- .../Migrations/Mysql/Version20120329220344.php | 11 ++++++----- .../Migrations/Mysql/Version20121001181137.php | 11 ++++++----- .../Migrations/Mysql/Version20121011140946.php | 11 ++++++----- .../Migrations/Mysql/Version20130522131641.php | 11 ++++++----- .../Migrations/Mysql/Version20130522132835.php | 11 ++++++----- .../Migrations/Mysql/Version20130605174712.php | 11 ++++++----- .../Migrations/Mysql/Version20141118172322.php | 11 ++++++----- .../Migrations/Mysql/Version20150228154201.php | 11 ++++++----- .../Migrations/Mysql/Version20150324185018.php | 11 ++++++----- .../Migrations/Mysql/Version20150507204450.php | 11 ++++++----- .../Migrations/Mysql/Version20150701113246.php | 11 ++++++----- .../Migrations/Mysql/Version20150913173832.php | 18 ++++++++++-------- .../Migrations/Mysql/Version20151216052338.php | 11 ++++++----- .../Migrations/Mysql/Version20151216143756.php | 11 ++++++----- .../Migrations/Mysql/Version20151216144408.php | 11 ++++++----- .../Migrations/Mysql/Version20160223165602.php | 11 ++++++----- .../Migrations/Mysql/Version20161125093810.php | 11 ++++++----- .../Migrations/Mysql/Version20161125172223.php | 11 ++++++----- .../Migrations/Mysql/Version20170110130217.php | 13 +++++++------ .../Migrations/Mysql/Version20170220155800.php | 13 +++++++------ .../Migrations/Mysql/Version20180405104603.php | 18 ++++++++++-------- .../Migrations/Mysql/Version20181104152203.php | 6 +++--- .../Migrations/Mysql/Version20190314150744.php | 12 +++++++----- .../Migrations/Mysql/Version20190315122900.php | 12 +++++++----- .../Migrations/Mysql/Version20191125132700.php | 8 ++++---- .../Migrations/Mysql/Version20200306233229.php | 13 +++++++------ .../Migrations/Mysql/Version20200823164700.php | 6 +++--- .../Migrations/Mysql/Version20200828170100.php | 6 +++--- .../Postgresql/Version20120412194612.php | 11 ++++++----- .../Postgresql/Version20121002120357.php | 11 ++++++----- .../Postgresql/Version20121011140946.php | 11 ++++++----- .../Postgresql/Version20130522131642.php | 11 ++++++----- .../Postgresql/Version20130522132836.php | 11 ++++++----- .../Postgresql/Version20130605174713.php | 11 ++++++----- .../Postgresql/Version20141118174900.php | 11 ++++++----- .../Postgresql/Version20141118174901.php | 11 ++++++----- .../Postgresql/Version20150131172631.php | 11 ++++++----- .../Postgresql/Version20150305113900.php | 11 ++++++----- .../Postgresql/Version20150324185008.php | 11 ++++++----- .../Postgresql/Version20150507204451.php | 11 ++++++----- .../Postgresql/Version20150701113247.php | 11 ++++++----- .../Postgresql/Version20150913173935.php | 18 ++++++++++-------- .../Postgresql/Version20151216054040.php | 11 ++++++----- .../Postgresql/Version20151216143845.php | 11 ++++++----- .../Postgresql/Version20151216144435.php | 11 ++++++----- .../Postgresql/Version20161125093811.php | 11 ++++++----- .../Postgresql/Version20161125172823.php | 11 ++++++----- .../Postgresql/Version20170110133136.php | 13 +++++++------ .../Postgresql/Version20170220155800.php | 13 +++++++------ .../Postgresql/Version20180406163142.php | 18 ++++++++++-------- .../Postgresql/Version20181104152204.php | 6 +++--- .../Postgresql/Version20190314150745.php | 12 +++++++----- .../Postgresql/Version20190315122901.php | 6 +++--- .../Postgresql/Version20191125132701.php | 8 ++++---- .../Postgresql/Version20200307122055.php | 13 +++++++------ .../Postgresql/Version20200823164701.php | 6 +++--- .../Postgresql/Version20200828170101.php | 6 +++--- .../Migrations/Mysql/Version20110620155002.php | 7 ++++--- .../Migrations/Mysql/Version20110824125035.php | 7 ++++--- .../Migrations/Mysql/Version20110919164835.php | 7 ++++--- .../Migrations/Mysql/Version20110923125538.php | 7 ++++--- .../Migrations/Mysql/Version20110925123119.php | 7 ++++--- .../Migrations/Mysql/Version20120329220343.php | 7 ++++--- .../Migrations/Mysql/Version20120429213448.php | 7 ++++--- .../Migrations/Mysql/Version20121001202223.php | 7 ++++--- .../Migrations/Mysql/Version20121030221151.php | 7 ++++--- .../Migrations/Mysql/Version20121031190213.php | 7 ++++--- .../Migrations/Mysql/Version20130213130515.php | 7 ++++--- .../Migrations/Mysql/Version20131111235827.php | 7 ++++--- .../Migrations/Mysql/Version20141017174559.php | 7 ++++--- .../Migrations/Mysql/Version20141114115241.php | 7 ++++--- .../Migrations/Mysql/Version20150224171107.php | 7 ++++--- .../Migrations/Mysql/Version20150309215317.php | 7 ++++--- .../Migrations/Mysql/Version20150507204452.php | 7 ++++--- .../Migrations/Mysql/Version20150724091148.php | 7 ++++--- .../Migrations/Mysql/Version20151117125551.php | 14 ++++++++------ .../Migrations/Mysql/Version20151223125909.php | 12 +++++++----- .../Migrations/Mysql/Version20160104121311.php | 12 +++++++----- .../Migrations/Mysql/Version20160212141523.php | 7 ++++--- .../Migrations/Mysql/Version20160223165603.php | 7 ++++--- .../Migrations/Mysql/Version20160411101457.php | 7 ++++--- .../Migrations/Mysql/Version20160411101458.php | 7 ++++--- .../Migrations/Mysql/Version20160711103441.php | 7 ++++--- .../Migrations/Mysql/Version20161125093800.php | 7 ++++--- .../Migrations/Mysql/Version20161125124749.php | 7 ++++--- .../Migrations/Mysql/Version20161125171231.php | 7 ++++--- .../Migrations/Mysql/Version20170110130253.php | 7 ++++--- .../Migrations/Mysql/Version20170115114801.php | 7 ++++--- .../Migrations/Mysql/Version20171206140453.php | 8 ++++---- .../Migrations/Mysql/Version20210125134503.php | 12 +++++++----- .../Migrations/Mysql/Version20211220145601.php | 7 ++++--- .../Migrations/Mysql/Version20231012072631.php | 5 +++-- .../Postgresql/Version20120412194614.php | 7 ++++--- .../Postgresql/Version20120429225208.php | 7 ++++--- .../Postgresql/Version20121002121215.php | 7 ++++--- .../Postgresql/Version20121030103851.php | 7 ++++--- .../Postgresql/Version20121031190214.php | 7 ++++--- .../Postgresql/Version20130213180302.php | 7 ++++--- .../Postgresql/Version20131112191120.php | 7 ++++--- .../Postgresql/Version20141125133037.php | 7 ++++--- .../Postgresql/Version20150224171108.php | 10 ++++++---- .../Postgresql/Version20150309212115.php | 7 ++++--- .../Postgresql/Version20150507204453.php | 7 ++++--- .../Postgresql/Version20150724091150.php | 7 ++++--- .../Postgresql/Version20151117125552.php | 14 ++++++++------ .../Postgresql/Version20151120170812.php | 7 ++++--- .../Postgresql/Version20151126122252.php | 7 ++++--- .../Postgresql/Version20151223125946.php | 12 +++++++----- .../Postgresql/Version20160104121413.php | 12 +++++++----- .../Postgresql/Version20160212141533.php | 10 +++++----- .../Postgresql/Version20160411101639.php | 7 ++++--- .../Postgresql/Version20160411101640.php | 7 ++++--- .../Postgresql/Version20160711103440.php | 7 ++++--- .../Postgresql/Version20161125093801.php | 7 ++++--- .../Postgresql/Version20161125125249.php | 7 ++++--- .../Postgresql/Version20161125171831.php | 7 ++++--- .../Postgresql/Version20161127010617.php | 7 ++++--- .../Postgresql/Version20170110133114.php | 7 ++++--- .../Postgresql/Version20170115115240.php | 7 ++++--- .../Postgresql/Version20170629102140.php | 5 +++-- .../Postgresql/Version20211220145602.php | 7 ++++--- .../Postgresql/Version20230727164600.php | 12 +++++++----- .../Migrations/Mysql/Version20161125123504.php | 7 ++++--- .../Postgresql/Version20161125125004.php | 7 ++++--- 125 files changed, 643 insertions(+), 513 deletions(-) diff --git a/Neos.Media/Migrations/Mysql/Version20110925123120.php b/Neos.Media/Migrations/Mysql/Version20110925123120.php index 712af63ad0f..eb92a3eea2c 100644 --- a/Neos.Media/Migrations/Mysql/Version20110925123120.php +++ b/Neos.Media/Migrations/Mysql/Version20110925123120.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("CREATE TABLE typo3_media_domain_model_image (flow3_persistence_identifier VARCHAR(40) NOT NULL, resource VARCHAR(40) DEFAULT NULL, title VARCHAR(255) DEFAULT NULL, width INT DEFAULT NULL, height INT DEFAULT NULL, type INT DEFAULT NULL, imagevariants LONGTEXT DEFAULT NULL COMMENT '(DC2Type:array)', INDEX IDX_7FA2358DBC91F416 (resource), PRIMARY KEY(flow3_persistence_identifier)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB"); @@ -31,9 +32,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("DROP TABLE typo3_media_domain_model_image"); } diff --git a/Neos.Media/Migrations/Mysql/Version20120329220344.php b/Neos.Media/Migrations/Mysql/Version20120329220344.php index 01383d3b8aa..6b71db2a87b 100644 --- a/Neos.Media/Migrations/Mysql/Version20120329220344.php +++ b/Neos.Media/Migrations/Mysql/Version20120329220344.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_image CHANGE title title VARCHAR(255) NOT NULL, CHANGE width width INT NOT NULL, CHANGE height height INT NOT NULL, CHANGE type type INT NOT NULL, CHANGE imagevariants imagevariants LONGTEXT NOT NULL COMMENT '(DC2Type:array)'"); } @@ -24,9 +25,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_image CHANGE title title VARCHAR(255) DEFAULT NULL, CHANGE width width INT DEFAULT NULL, CHANGE height height INT DEFAULT NULL, CHANGE type type INT DEFAULT NULL, CHANGE imagevariants imagevariants LONGTEXT DEFAULT NULL COMMENT '(DC2Type:array)'"); } diff --git a/Neos.Media/Migrations/Mysql/Version20121001181137.php b/Neos.Media/Migrations/Mysql/Version20121001181137.php index dcf473d7185..8c375209012 100644 --- a/Neos.Media/Migrations/Mysql/Version20121001181137.php +++ b/Neos.Media/Migrations/Mysql/Version20121001181137.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); // collect foreign keys pointing to "our" tables $foreignKeyHandlingSql = Service::getForeignKeyHandlingSql($schema, $this->platform, array('typo3_media_domain_model_image'), 'flow3_persistence_identifier', 'persistence_object_identifier'); @@ -41,9 +42,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); // collect foreign keys pointing to "our" tables $foreignKeyHandlingSql = Service::getForeignKeyHandlingSql($schema, $this->platform, array('typo3_media_domain_model_image'), 'persistence_object_identifier', 'flow3_persistence_identifier'); diff --git a/Neos.Media/Migrations/Mysql/Version20121011140946.php b/Neos.Media/Migrations/Mysql/Version20121011140946.php index 83c118ed0cc..958f8f63288 100644 --- a/Neos.Media/Migrations/Mysql/Version20121011140946.php +++ b/Neos.Media/Migrations/Mysql/Version20121011140946.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("UPDATE typo3_media_domain_model_image SET imagevariants = REPLACE(imagevariants, 's:31:\"\0*\0FLOW3_Persistence_Identifier\";', 's:32:\"\0*\0Persistence_Object_Identifier\";') WHERE imagevariants LIKE '%s:31:\"\0*\0FLOW3_Persistence_Identifier\";%'"); $this->addSql("UPDATE typo3_media_domain_model_image SET imagevariants = REPLACE(imagevariants, 's:33:\"FLOW3_Persistence_RelatedEntities\";', 's:32:\"Flow_Persistence_RelatedEntities\";') WHERE imagevariants LIKE '%s:33:\"FLOW3_Persistence_RelatedEntities\";%'"); @@ -27,9 +28,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("UPDATE typo3_media_domain_model_image SET imagevariants = REPLACE(imagevariants, 's:28:\"TYPO3\\\\Flow\\\\Resource\\\\Resource\";', 's:29:\"TYPO3\\\\FLOW3\\\\Resource\\\\Resource\";') WHERE imagevariants LIKE '%s:28:\"TYPO3\\\\\\\\Flow\\\\\\\\Resource\\\\\\\\Resource\";%'"); $this->addSql("UPDATE typo3_media_domain_model_image SET imagevariants = REPLACE(imagevariants, 's:32:\"Flow_Persistence_RelatedEntities\";', 's:33:\"FLOW3_Persistence_RelatedEntities\";') WHERE imagevariants LIKE '%s:32:\"Flow_Persistence_RelatedEntities\";%'"); diff --git a/Neos.Media/Migrations/Mysql/Version20130522131641.php b/Neos.Media/Migrations/Mysql/Version20130522131641.php index ca3df92b152..a4f9829b3c3 100644 --- a/Neos.Media/Migrations/Mysql/Version20130522131641.php +++ b/Neos.Media/Migrations/Mysql/Version20130522131641.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); // new tables for Asset, Document, Video, Audio $this->addSql("CREATE TABLE typo3_media_domain_model_asset (persistence_object_identifier VARCHAR(40) NOT NULL, dtype VARCHAR(255) NOT NULL, resource VARCHAR(40) DEFAULT NULL, title VARCHAR(255) NOT NULL, INDEX IDX_B8306B8EBC91F416 (resource), PRIMARY KEY(persistence_object_identifier)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB"); @@ -42,9 +43,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); // adjust Image table $this->addSql("ALTER TABLE typo3_media_domain_model_image DROP FOREIGN KEY FK_7FA2358D47A46B0A"); diff --git a/Neos.Media/Migrations/Mysql/Version20130522132835.php b/Neos.Media/Migrations/Mysql/Version20130522132835.php index b9f8f4ae27c..7160bdd8b71 100644 --- a/Neos.Media/Migrations/Mysql/Version20130522132835.php +++ b/Neos.Media/Migrations/Mysql/Version20130522132835.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("CREATE TABLE typo3_media_domain_model_asset_tags_join (media_asset VARCHAR(40) NOT NULL, media_tag VARCHAR(40) NOT NULL, INDEX IDX_DAF7A1EB1DB69EED (media_asset), INDEX IDX_DAF7A1EB48D8C57E (media_tag), PRIMARY KEY(media_asset, media_tag)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB"); $this->addSql("CREATE TABLE typo3_media_domain_model_tag (persistence_object_identifier VARCHAR(40) NOT NULL, `label` VARCHAR(255) NOT NULL, PRIMARY KEY(persistence_object_identifier)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB"); @@ -27,9 +28,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_asset_tags_join DROP FOREIGN KEY FK_DAF7A1EB48D8C57E"); $this->addSql("DROP TABLE typo3_media_domain_model_asset_tags_join"); diff --git a/Neos.Media/Migrations/Mysql/Version20130605174712.php b/Neos.Media/Migrations/Mysql/Version20130605174712.php index 9440c3d7853..84be1513584 100644 --- a/Neos.Media/Migrations/Mysql/Version20130605174712.php +++ b/Neos.Media/Migrations/Mysql/Version20130605174712.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_asset ADD caption LONGTEXT NOT NULL"); $this->addSql("ALTER TABLE typo3_media_domain_model_asset ADD lastmodified DATETIME NOT NULL"); @@ -25,9 +26,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_asset DROP lastmodified"); $this->addSql("ALTER TABLE typo3_media_domain_model_asset DROP caption"); diff --git a/Neos.Media/Migrations/Mysql/Version20141118172322.php b/Neos.Media/Migrations/Mysql/Version20141118172322.php index 9213cf1a02e..c2f5be91af0 100644 --- a/Neos.Media/Migrations/Mysql/Version20141118172322.php +++ b/Neos.Media/Migrations/Mysql/Version20141118172322.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("CREATE TABLE typo3_media_domain_model_adjustment_abstractimageadjustment (persistence_object_identifier VARCHAR(40) NOT NULL, imagevariant VARCHAR(40) DEFAULT NULL, dtype VARCHAR(255) NOT NULL, x INT DEFAULT NULL, y INT DEFAULT NULL, width INT DEFAULT NULL, height INT DEFAULT NULL, maximumwidth INT DEFAULT NULL, maximumheight INT DEFAULT NULL, minimumwidth INT DEFAULT NULL, minimumheight INT DEFAULT NULL, ratiomode VARCHAR(255) DEFAULT NULL, INDEX IDX_84416FDCA76D06E6 (imagevariant), PRIMARY KEY(persistence_object_identifier)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB"); $this->addSql("CREATE TABLE typo3_media_domain_model_imagevariant (persistence_object_identifier VARCHAR(40) NOT NULL, originalasset VARCHAR(40) NOT NULL, name VARCHAR(255) NOT NULL, width INT NOT NULL, height INT NOT NULL, INDEX IDX_758EDEBD55FF4171 (originalasset), PRIMARY KEY(persistence_object_identifier)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB"); @@ -33,9 +34,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_adjustment_abstractimageadjustment DROP FOREIGN KEY FK_84416FDCA76D06E6"); $this->addSql("DROP TABLE typo3_media_domain_model_adjustment_abstractimageadjustment"); diff --git a/Neos.Media/Migrations/Mysql/Version20150228154201.php b/Neos.Media/Migrations/Mysql/Version20150228154201.php index b7e8b0801db..56c766c2e97 100644 --- a/Neos.Media/Migrations/Mysql/Version20150228154201.php +++ b/Neos.Media/Migrations/Mysql/Version20150228154201.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_adjustment_abstractimageadjustment ADD position INT NOT NULL"); $this->addSql("UPDATE typo3_media_domain_model_adjustment_abstractimageadjustment SET position = 10 WHERE dtype = 'typo3_media_adjustment_cropimageadjustment'"); $this->addSql("UPDATE typo3_media_domain_model_adjustment_abstractimageadjustment SET position = 20 WHERE dtype = 'typo3_media_adjustment_resizeimageadjustment'"); @@ -25,9 +26,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_adjustment_abstractimageadjustment DROP position"); } diff --git a/Neos.Media/Migrations/Mysql/Version20150324185018.php b/Neos.Media/Migrations/Mysql/Version20150324185018.php index 83369915c0c..a5088e4bca5 100644 --- a/Neos.Media/Migrations/Mysql/Version20150324185018.php +++ b/Neos.Media/Migrations/Mysql/Version20150324185018.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_adjustment_abstractimageadjustment ADD allowupscaling TINYINT(1) DEFAULT NULL"); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail ADD allowupscaling TINYINT(1) DEFAULT NULL"); } @@ -26,9 +27,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_adjustment_abstractimageadjustment DROP allowupscaling"); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail DROP allowupscaling"); } diff --git a/Neos.Media/Migrations/Mysql/Version20150507204450.php b/Neos.Media/Migrations/Mysql/Version20150507204450.php index b975803d371..026ddca4cae 100644 --- a/Neos.Media/Migrations/Mysql/Version20150507204450.php +++ b/Neos.Media/Migrations/Mysql/Version20150507204450.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("CREATE TABLE typo3_media_domain_model_assetcollection (persistence_object_identifier VARCHAR(40) NOT NULL, title VARCHAR(255) NOT NULL, PRIMARY KEY(persistence_object_identifier)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB"); $this->addSql("CREATE TABLE typo3_media_domain_model_assetcollection_assets_join (media_assetcollection VARCHAR(40) NOT NULL, media_asset VARCHAR(40) NOT NULL, INDEX IDX_E90D72512A965871 (media_assetcollection), INDEX IDX_E90D72511DB69EED (media_asset), PRIMARY KEY(media_assetcollection, media_asset)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB"); @@ -30,9 +31,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_assetcollection_assets_join DROP FOREIGN KEY FK_E90D72512A965871"); $this->addSql("ALTER TABLE typo3_media_domain_model_assetcollection_tags_join DROP FOREIGN KEY FK_A41705672A965871"); diff --git a/Neos.Media/Migrations/Mysql/Version20150701113246.php b/Neos.Media/Migrations/Mysql/Version20150701113246.php index a9ebb6c5230..fca41397b05 100644 --- a/Neos.Media/Migrations/Mysql/Version20150701113246.php +++ b/Neos.Media/Migrations/Mysql/Version20150701113246.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_image CHANGE width width INT DEFAULT NULL, CHANGE height height INT DEFAULT NULL"); $this->addSql("ALTER TABLE typo3_media_domain_model_imagevariant CHANGE width width INT DEFAULT NULL, CHANGE height height INT DEFAULT NULL"); @@ -26,9 +27,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_image CHANGE width width INT NOT NULL, CHANGE height height INT NOT NULL"); $this->addSql("ALTER TABLE typo3_media_domain_model_imagevariant CHANGE width width INT NOT NULL, CHANGE height height INT NOT NULL"); diff --git a/Neos.Media/Migrations/Mysql/Version20150913173832.php b/Neos.Media/Migrations/Mysql/Version20150913173832.php index 919a8bbfeb1..41aa88f4936 100644 --- a/Neos.Media/Migrations/Mysql/Version20150913173832.php +++ b/Neos.Media/Migrations/Mysql/Version20150913173832.php @@ -1,8 +1,10 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail ADD configuration LONGTEXT NOT NULL COMMENT '(DC2Type:json_array)', ADD configurationhash VARCHAR(32) NOT NULL"); $thumbnailResult = $this->connection->executeQuery('SELECT * FROM typo3_media_domain_model_thumbnail'); - while ($thumbnailInfo = $thumbnailResult->fetch(\PDO::FETCH_ASSOC)) { + while ($thumbnailInfo = $thumbnailResult->fetch(PDO::FETCH_ASSOC)) { $configurationArray = array_filter([ 'maximumWidth' => $thumbnailInfo['maximumwidth'], 'maximumHeight' => $thumbnailInfo['maximumheight'], @@ -43,14 +45,14 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail ADD maximumwidth INT DEFAULT NULL, ADD maximumheight INT DEFAULT NULL, ADD ratiomode VARCHAR(255) NOT NULL COLLATE utf8mb4_unicode_ci, ADD allowupscaling TINYINT(1) DEFAULT NULL"); $thumbnailResult = $this->connection->executeQuery('SELECT * FROM typo3_media_domain_model_thumbnail'); - while ($thumbnailInfo = $thumbnailResult->fetch(\PDO::FETCH_ASSOC)) { + while ($thumbnailInfo = $thumbnailResult->fetch(PDO::FETCH_ASSOC)) { $configuration = json_decode($thumbnailInfo['configuration'], true); $maximumWidth = isset($configuration['maximumWidth']) ? (integer)$configuration['maximumWidth'] : null; $maximumWidth = $maximumWidth === 0 ? null : $maximumWidth; @@ -59,7 +61,7 @@ public function down(Schema $schema): void $ratioMode = isset($configuration['ratioMode']) ? $configuration['ratioMode'] : null; $allowUpScaling = isset($configuration['allowUpScaling']) ? $configuration['allowUpScaling'] : null; $allowUpScaling = $allowUpScaling ? 1 : 0; - $types = [\PDO::PARAM_NULL]; + $types = [PDO::PARAM_NULL]; $this->addSql("UPDATE typo3_media_domain_model_thumbnail SET maximumwidth = ?, maximumheight = ?, ratiomode = ?, allowupscaling = ? WHERE persistence_object_identifier = ?", [$maximumWidth, $maximumHeight, $ratioMode, $allowUpScaling, $thumbnailInfo['persistence_object_identifier']], $types); } diff --git a/Neos.Media/Migrations/Mysql/Version20151216052338.php b/Neos.Media/Migrations/Mysql/Version20151216052338.php index fffcee191df..15ea6ea51fa 100644 --- a/Neos.Media/Migrations/Mysql/Version20151216052338.php +++ b/Neos.Media/Migrations/Mysql/Version20151216052338.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail CHANGE resource resource VARCHAR(40) DEFAULT NULL"); } @@ -24,9 +25,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail CHANGE resource resource VARCHAR(40) NOT NULL COLLATE utf8mb4_unicode_ci"); } diff --git a/Neos.Media/Migrations/Mysql/Version20151216143756.php b/Neos.Media/Migrations/Mysql/Version20151216143756.php index b7dce1c37b2..9a4852bf6b9 100644 --- a/Neos.Media/Migrations/Mysql/Version20151216143756.php +++ b/Neos.Media/Migrations/Mysql/Version20151216143756.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail ADD staticresource VARCHAR(255) DEFAULT NULL"); } @@ -24,9 +25,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail DROP staticresource"); } diff --git a/Neos.Media/Migrations/Mysql/Version20151216144408.php b/Neos.Media/Migrations/Mysql/Version20151216144408.php index bdad35fbb01..75e5cfb9a90 100644 --- a/Neos.Media/Migrations/Mysql/Version20151216144408.php +++ b/Neos.Media/Migrations/Mysql/Version20151216144408.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("TRUNCATE TABLE typo3_media_domain_model_thumbnail"); $this->addSql("DROP INDEX originalasset_configurationhash ON typo3_media_domain_model_thumbnail"); @@ -26,9 +27,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("DROP INDEX originalasset_configurationhash ON typo3_media_domain_model_thumbnail"); $this->addSql("CREATE INDEX originalasset_configurationhash ON typo3_media_domain_model_thumbnail (originalasset, configurationhash)"); diff --git a/Neos.Media/Migrations/Mysql/Version20160223165602.php b/Neos.Media/Migrations/Mysql/Version20160223165602.php index cdefb4f6cee..67b485c8c5b 100644 --- a/Neos.Media/Migrations/Mysql/Version20160223165602.php +++ b/Neos.Media/Migrations/Mysql/Version20160223165602.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail CHANGE configuration configuration LONGTEXT NOT NULL COMMENT '(DC2Type:flow_json_array)'"); } @@ -25,9 +26,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail CHANGE configuration configuration LONGTEXT NOT NULL COMMENT '(DC2Type:json_array)'"); } diff --git a/Neos.Media/Migrations/Mysql/Version20161125093810.php b/Neos.Media/Migrations/Mysql/Version20161125093810.php index 879b989bd95..5ce2420aea1 100644 --- a/Neos.Media/Migrations/Mysql/Version20161125093810.php +++ b/Neos.Media/Migrations/Mysql/Version20161125093810.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('RENAME TABLE typo3_media_domain_model_adjustment_abstractimageadjustment TO neos_media_domain_model_adjustment_abstractimageadjustment'); $this->addSql('RENAME TABLE typo3_media_domain_model_asset TO neos_media_domain_model_asset'); @@ -36,9 +37,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('RENAME TABLE neos_media_domain_model_adjustment_abstractimageadjustment TO typo3_media_domain_model_adjustment_abstractimageadjustment'); $this->addSql('RENAME TABLE neos_media_domain_model_asset TO typo3_media_domain_model_asset'); diff --git a/Neos.Media/Migrations/Mysql/Version20161125172223.php b/Neos.Media/Migrations/Mysql/Version20161125172223.php index 42adbb65601..2f8e6b95b60 100644 --- a/Neos.Media/Migrations/Mysql/Version20161125172223.php +++ b/Neos.Media/Migrations/Mysql/Version20161125172223.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql("UPDATE neos_media_domain_model_asset SET dtype = REPLACE(dtype, 'typo3_media_', 'neos_media_')"); $this->addSql("UPDATE neos_media_domain_model_adjustment_abstractimageadjustment SET dtype = REPLACE(dtype, 'typo3_media_', 'neos_media_')"); @@ -25,9 +26,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql("UPDATE neos_media_domain_model_asset SET dtype = REPLACE(dtype, 'neos_media_', 'typo3_media_')"); $this->addSql("UPDATE neos_media_domain_model_adjustment_abstractimageadjustment SET dtype = REPLACE(dtype, 'neos_media_', 'typo3_media_')"); diff --git a/Neos.Media/Migrations/Mysql/Version20170110130217.php b/Neos.Media/Migrations/Mysql/Version20170110130217.php index 24d94d8c6af..49efc3e9388 100644 --- a/Neos.Media/Migrations/Mysql/Version20170110130217.php +++ b/Neos.Media/Migrations/Mysql/Version20170110130217.php @@ -1,9 +1,10 @@ abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); // Renaming of indexes is only possible with MySQL version 5.7+ if ($this->connection->getDatabasePlatform() instanceof MySQL57Platform) { @@ -92,9 +93,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); // Renaming of indexes is only possible with MySQL version 5.7+ if ($this->connection->getDatabasePlatform() instanceof MySQL57Platform) { diff --git a/Neos.Media/Migrations/Mysql/Version20170220155800.php b/Neos.Media/Migrations/Mysql/Version20170220155800.php index 7195d606e0f..43462e7dd4b 100644 --- a/Neos.Media/Migrations/Mysql/Version20170220155800.php +++ b/Neos.Media/Migrations/Mysql/Version20170220155800.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('ALTER TABLE neos_media_domain_model_adjustment_abstractimageadjustment ADD quality INT DEFAULT NULL'); $this->addSql('ALTER TABLE neos_media_domain_model_thumbnail ADD quality INT DEFAULT NULL'); } @@ -32,9 +33,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('ALTER TABLE neos_media_domain_model_adjustment_abstractimageadjustment DROP quality'); $this->addSql('ALTER TABLE neos_media_domain_model_thumbnail DROP quality'); } diff --git a/Neos.Media/Migrations/Mysql/Version20180405104603.php b/Neos.Media/Migrations/Mysql/Version20180405104603.php index 2efeaae2d88..4e4844d5526 100644 --- a/Neos.Media/Migrations/Mysql/Version20180405104603.php +++ b/Neos.Media/Migrations/Mysql/Version20180405104603.php @@ -1,8 +1,10 @@ abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('CREATE TABLE neos_media_domain_model_importedasset (persistence_object_identifier VARCHAR(40) NOT NULL, assetsourceidentifier VARCHAR(255) NOT NULL, remoteassetidentifier VARCHAR(255) NOT NULL, localassetidentifier VARCHAR(255) NOT NULL, localoriginalassetidentifier VARCHAR(255) DEFAULT NULL, importedat DATETIME NOT NULL, UNIQUE INDEX flow_identity_neos_media_domain_model_importedasset (assetsourceidentifier, remoteassetidentifier, localassetidentifier), PRIMARY KEY(persistence_object_identifier)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB'); $this->addSql('ALTER TABLE neos_media_domain_model_asset ADD assetsourceidentifier VARCHAR(255) DEFAULT \'neos\''); @@ -34,11 +36,11 @@ public function up(Schema $schema): void /** * @param Schema $schema * @return void - * @throws \Doctrine\DBAL\Migrations\AbortMigrationException + * @throws AbortMigrationException */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('DROP TABLE neos_media_domain_model_importedasset'); $this->addSql('ALTER TABLE neos_media_domain_model_asset DROP assetsourceidentifier'); diff --git a/Neos.Media/Migrations/Mysql/Version20181104152203.php b/Neos.Media/Migrations/Mysql/Version20181104152203.php index a5232d62e56..ae8d945e9ae 100644 --- a/Neos.Media/Migrations/Mysql/Version20181104152203.php +++ b/Neos.Media/Migrations/Mysql/Version20181104152203.php @@ -12,7 +12,7 @@ */ use Doctrine\DBAL\Exception as DBALException; -use Doctrine\Migrations\Exception\AbortMigration as AbortMigrationException; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; @@ -35,7 +35,7 @@ public function getDescription(): string public function up(Schema $schema): void { // this up() migration is autogenerated, please modify it to your needs - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('ALTER TABLE neos_media_domain_model_asset ADD copyrightnotice LONGTEXT NOT NULL'); } @@ -48,7 +48,7 @@ public function up(Schema $schema): void public function down(Schema $schema): void { // this down() migration is autogenerated, please modify it to your needs - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('ALTER TABLE neos_media_domain_model_asset DROP copyrightnotice'); } diff --git a/Neos.Media/Migrations/Mysql/Version20190314150744.php b/Neos.Media/Migrations/Mysql/Version20190314150744.php index 1fdb27ea006..f24d9e92996 100644 --- a/Neos.Media/Migrations/Mysql/Version20190314150744.php +++ b/Neos.Media/Migrations/Mysql/Version20190314150744.php @@ -1,8 +1,10 @@ abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); // It is now safe the remove the default value from the database schema, as we only needed it during migration of earlier Neos versions: $this->addSql('ALTER TABLE neos_media_domain_model_asset CHANGE assetsourceidentifier assetsourceidentifier VARCHAR(255) NOT NULL'); @@ -40,11 +42,11 @@ public function up(Schema $schema): void /** * @param Schema $schema * @return void - * @throws \Doctrine\DBAL\Exception + * @throws Exception */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('ALTER TABLE neos_media_domain_model_asset CHANGE assetsourceidentifier assetsourceidentifier VARCHAR(255) DEFAULT \'neos\' COLLATE utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE neos_media_domain_model_imagevariant DROP presetidentifier, DROP presetvariantname'); diff --git a/Neos.Media/Migrations/Mysql/Version20190315122900.php b/Neos.Media/Migrations/Mysql/Version20190315122900.php index 478e49e3535..075d2fd2cf9 100644 --- a/Neos.Media/Migrations/Mysql/Version20190315122900.php +++ b/Neos.Media/Migrations/Mysql/Version20190315122900.php @@ -1,8 +1,10 @@ abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('ALTER TABLE neos_media_domain_model_adjustment_abstractimageadjustment ADD aspectratioasstring VARCHAR(255) DEFAULT NULL'); } /** * @param Schema $schema * @return void - * @throws \Doctrine\DBAL\Exception + * @throws Exception */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('ALTER TABLE neos_media_domain_model_adjustment_abstractimageadjustment DROP aspectratioasstring'); } } diff --git a/Neos.Media/Migrations/Mysql/Version20191125132700.php b/Neos.Media/Migrations/Mysql/Version20191125132700.php index 8e2d8fe4682..1be4dd094c1 100644 --- a/Neos.Media/Migrations/Mysql/Version20191125132700.php +++ b/Neos.Media/Migrations/Mysql/Version20191125132700.php @@ -4,9 +4,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; use Doctrine\DBAL\Exception as DBALException; -use Doctrine\Migrations\Exception\AbortMigration as AbortMigrationException; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Set default for ratio mode for image adjustments @@ -29,7 +29,7 @@ public function getDescription(): string */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('UPDATE neos_media_domain_model_adjustment_abstractimageadjustment SET ratiomode=\'inset\' WHERE (ratiomode IS NULL OR ratiomode=\'\') AND dtype=\'neos_media_adjustment_resizeimageadjustment\''); } @@ -40,6 +40,6 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); } } diff --git a/Neos.Media/Migrations/Mysql/Version20200306233229.php b/Neos.Media/Migrations/Mysql/Version20200306233229.php index 940984f1fb1..8e2395ee30c 100644 --- a/Neos.Media/Migrations/Mysql/Version20200306233229.php +++ b/Neos.Media/Migrations/Mysql/Version20200306233229.php @@ -3,9 +3,10 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Exception; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; -use Doctrine\Migrations\Exception\AbortMigration as AbortMigrationException; +use Doctrine\Migrations\AbstractMigration; class Version20200306233229 extends AbstractMigration { @@ -21,12 +22,12 @@ public function getDescription(): string /** * @param Schema $schema * @return void - * @throws \Doctrine\DBAL\Exception + * @throws Exception */ public function up(Schema $schema): void { // this up() migration is autogenerated, please modify it to your needs - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('ALTER TABLE neos_media_domain_model_tag ADD parent VARCHAR(40) DEFAULT NULL'); $this->addSql('ALTER TABLE neos_media_domain_model_tag ADD CONSTRAINT FK_CA4889693D8E604F FOREIGN KEY (parent) REFERENCES neos_media_domain_model_tag (persistence_object_identifier)'); @@ -36,12 +37,12 @@ public function up(Schema $schema): void /** * @param Schema $schema * @return void - * @throws \Doctrine\DBAL\Exception + * @throws Exception */ public function down(Schema $schema): void { // this down() migration is autogenerated, please modify it to your needs - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('ALTER TABLE neos_media_domain_model_tag DROP FOREIGN KEY FK_CA4889693D8E604F'); $this->addSql('DROP INDEX IDX_CA4889693D8E604F ON neos_media_domain_model_tag'); diff --git a/Neos.Media/Migrations/Mysql/Version20200823164700.php b/Neos.Media/Migrations/Mysql/Version20200823164700.php index 99e27171439..b7cb1ca4997 100644 --- a/Neos.Media/Migrations/Mysql/Version20200823164700.php +++ b/Neos.Media/Migrations/Mysql/Version20200823164700.php @@ -4,7 +4,7 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; use Doctrine\DBAL\Exception as DBALException; -use Doctrine\Migrations\Exception\AbortMigration as AbortMigrationException; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; @@ -32,7 +32,7 @@ public function getDescription(): string */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); foreach (self::TYPES as $type) { $this->addSql(sprintf( @@ -50,7 +50,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); foreach (self::TYPES as $type) { $this->addSql(sprintf( diff --git a/Neos.Media/Migrations/Mysql/Version20200828170100.php b/Neos.Media/Migrations/Mysql/Version20200828170100.php index 7e71a6e096f..307b4c48f9c 100644 --- a/Neos.Media/Migrations/Mysql/Version20200828170100.php +++ b/Neos.Media/Migrations/Mysql/Version20200828170100.php @@ -4,7 +4,7 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; use Doctrine\DBAL\Exception as DBALException; -use Doctrine\Migrations\Exception\AbortMigration as AbortMigrationException; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; @@ -28,7 +28,7 @@ public function getDescription(): string */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql("UPDATE neos_media_domain_model_thumbnail SET staticresource = REPLACE(staticresource, 'resource://TYPO3.Media/Public/Icons/512px/', 'resource://Neos.Media/Public/IconSets/vivid/')"); $this->addSql("UPDATE neos_media_domain_model_thumbnail SET staticresource = REPLACE(staticresource, '.png', '.svg')"); @@ -41,7 +41,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql("UPDATE neos_media_domain_model_thumbnail SET staticresource = REPLACE(staticresource, 'resource://Neos.Media/Public/IconSets/vivid/', 'resource://TYPO3.Media/Public/Icons/512px/')"); $this->addSql("UPDATE neos_media_domain_model_thumbnail SET staticresource = REPLACE(staticresource, '.svg', '.png')"); diff --git a/Neos.Media/Migrations/Postgresql/Version20120412194612.php b/Neos.Media/Migrations/Postgresql/Version20120412194612.php index f950000a79c..ed9de4dd884 100644 --- a/Neos.Media/Migrations/Postgresql/Version20120412194612.php +++ b/Neos.Media/Migrations/Postgresql/Version20120412194612.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("CREATE TABLE typo3_media_domain_model_image (flow3_persistence_identifier VARCHAR(40) NOT NULL, resource VARCHAR(40) DEFAULT NULL, title VARCHAR(255) NOT NULL, width INT NOT NULL, height INT NOT NULL, type INT NOT NULL, imagevariants TEXT NOT NULL, PRIMARY KEY(flow3_persistence_identifier))"); $this->addSql("CREATE INDEX IDX_7FA2358DBC91F416 ON typo3_media_domain_model_image (resource)"); @@ -33,9 +34,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_image DROP CONSTRAINT FK_7FA2358DBC91F416"); $this->addSql("DROP TABLE typo3_media_domain_model_image"); diff --git a/Neos.Media/Migrations/Postgresql/Version20121002120357.php b/Neos.Media/Migrations/Postgresql/Version20121002120357.php index 0e4ffbb8e36..5687dc1c667 100644 --- a/Neos.Media/Migrations/Postgresql/Version20121002120357.php +++ b/Neos.Media/Migrations/Postgresql/Version20121002120357.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); // collect foreign keys pointing to "our" tables $foreignKeyHandlingSql = Service::getForeignKeyHandlingSql($schema, $this->platform, array('typo3_media_domain_model_image'), 'flow3_persistence_identifier', 'persistence_object_identifier'); @@ -39,9 +40,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); // collect foreign keys pointing to "our" tables $foreignKeyHandlingSql = Service::getForeignKeyHandlingSql($schema, $this->platform, array('typo3_media_domain_model_image'), 'persistence_object_identifier', 'flow3_persistence_identifier'); diff --git a/Neos.Media/Migrations/Postgresql/Version20121011140946.php b/Neos.Media/Migrations/Postgresql/Version20121011140946.php index 57fdba53964..4ab8442ea28 100644 --- a/Neos.Media/Migrations/Postgresql/Version20121011140946.php +++ b/Neos.Media/Migrations/Postgresql/Version20121011140946.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("UPDATE typo3_media_domain_model_image SET imagevariants = REPLACE(imagevariants, 's:31:\"\\000*\\000FLOW3_Persistence_Identifier\";', 's:32:\"\\000*\\000Persistence_Object_Identifier\";') WHERE imagevariants LIKE '%s:31:\"\\000*\\000FLOW3_Persistence_Identifier\";%'"); $this->addSql("UPDATE typo3_media_domain_model_image SET imagevariants = REPLACE(imagevariants, 's:33:\"FLOW3_Persistence_RelatedEntities\";', 's:32:\"Flow_Persistence_RelatedEntities\";') WHERE imagevariants LIKE '%s:33:\"FLOW3_Persistence_RelatedEntities\";%'"); @@ -27,9 +28,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("UPDATE typo3_media_domain_model_image SET imagevariants = REPLACE(imagevariants, 's:28:\"TYPO3\\\\Flow\\\\Resource\\\\Resource\";', 's:29:\"TYPO3\\\\FLOW3\\\\Resource\\\\Resource\";') WHERE imagevariants LIKE '%s:28:\"TYPO3\\\\\\\\Flow\\\\\\\\Resource\\\\\\\\Resource\";%'"); $this->addSql("UPDATE typo3_media_domain_model_image SET imagevariants = REPLACE(imagevariants, 's:32:\"Flow_Persistence_RelatedEntities\";', 's:33:\"FLOW3_Persistence_RelatedEntities\";') WHERE imagevariants LIKE '%s:32:\"Flow_Persistence_RelatedEntities\";%'"); diff --git a/Neos.Media/Migrations/Postgresql/Version20130522131642.php b/Neos.Media/Migrations/Postgresql/Version20130522131642.php index 238eeb76cca..4c772c95cd0 100644 --- a/Neos.Media/Migrations/Postgresql/Version20130522131642.php +++ b/Neos.Media/Migrations/Postgresql/Version20130522131642.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); // new tables for Asset, Document, Video, Audio $this->addSql("CREATE TABLE typo3_media_domain_model_asset (persistence_object_identifier VARCHAR(40) NOT NULL, resource VARCHAR(40) DEFAULT NULL, title VARCHAR(255) NOT NULL, dtype VARCHAR(255) NOT NULL, PRIMARY KEY(persistence_object_identifier))"); @@ -41,9 +42,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); // adjust Image table $this->addSql("ALTER TABLE typo3_media_domain_model_image ADD resource VARCHAR(40) DEFAULT NULL"); diff --git a/Neos.Media/Migrations/Postgresql/Version20130522132836.php b/Neos.Media/Migrations/Postgresql/Version20130522132836.php index da141dacb64..d3f3e89ee88 100644 --- a/Neos.Media/Migrations/Postgresql/Version20130522132836.php +++ b/Neos.Media/Migrations/Postgresql/Version20130522132836.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("CREATE TABLE typo3_media_domain_model_asset_tags_join (media_asset VARCHAR(40) NOT NULL, media_tag VARCHAR(40) NOT NULL, PRIMARY KEY(media_asset, media_tag))"); $this->addSql("CREATE INDEX IDX_DAF7A1EB1DB69EED ON typo3_media_domain_model_asset_tags_join (media_asset)"); @@ -29,9 +30,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_asset_tags_join DROP CONSTRAINT FK_DAF7A1EB1DB69EED"); $this->addSql("ALTER TABLE typo3_media_domain_model_asset_tags_join DROP CONSTRAINT FK_DAF7A1EB48D8C57E"); diff --git a/Neos.Media/Migrations/Postgresql/Version20130605174713.php b/Neos.Media/Migrations/Postgresql/Version20130605174713.php index 0a614b637bd..acb87cc6742 100644 --- a/Neos.Media/Migrations/Postgresql/Version20130605174713.php +++ b/Neos.Media/Migrations/Postgresql/Version20130605174713.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_asset ADD caption TEXT NOT NULL"); $this->addSql("ALTER TABLE typo3_media_domain_model_asset ADD lastmodified TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL"); @@ -25,9 +26,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_asset DROP lastmodified"); $this->addSql("ALTER TABLE typo3_media_domain_model_asset DROP caption"); diff --git a/Neos.Media/Migrations/Postgresql/Version20141118174900.php b/Neos.Media/Migrations/Postgresql/Version20141118174900.php index 504c217f729..77220e2c890 100644 --- a/Neos.Media/Migrations/Postgresql/Version20141118174900.php +++ b/Neos.Media/Migrations/Postgresql/Version20141118174900.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("CREATE TABLE typo3_media_domain_model_adjustment_abstractimageadjustment (persistence_object_identifier VARCHAR(40) NOT NULL, imagevariant VARCHAR(40) DEFAULT NULL, dtype VARCHAR(255) NOT NULL, x INT DEFAULT NULL, y INT DEFAULT NULL, width INT DEFAULT NULL, height INT DEFAULT NULL, maximumwidth INT DEFAULT NULL, maximumheight INT DEFAULT NULL, minimumwidth INT DEFAULT NULL, minimumheight INT DEFAULT NULL, ratiomode INT DEFAULT NULL, PRIMARY KEY(persistence_object_identifier))"); $this->addSql("CREATE INDEX IDX_84416FDCA76D06E6 ON typo3_media_domain_model_adjustment_abstractimageadjustment (imagevariant)"); @@ -39,9 +40,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_adjustment_abstractimageadjustment DROP CONSTRAINT FK_84416FDCA76D06E6"); $this->addSql("DROP TABLE typo3_media_domain_model_adjustment_abstractimageadjustment"); diff --git a/Neos.Media/Migrations/Postgresql/Version20141118174901.php b/Neos.Media/Migrations/Postgresql/Version20141118174901.php index 7335cbf70f5..b39ce1f483f 100644 --- a/Neos.Media/Migrations/Postgresql/Version20141118174901.php +++ b/Neos.Media/Migrations/Postgresql/Version20141118174901.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_adjustment_abstractimageadjustment ALTER ratiomode TYPE VARCHAR(255)"); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail ALTER ratiomode TYPE VARCHAR(255)"); @@ -25,9 +26,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_adjustment_abstractimageadjustment ALTER ratiomode TYPE INT USING (ratiomode::integer)"); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail ALTER ratiomode TYPE INT USING (ratiomode::integer)"); diff --git a/Neos.Media/Migrations/Postgresql/Version20150131172631.php b/Neos.Media/Migrations/Postgresql/Version20150131172631.php index 5ce74bb2d97..4447a2a8610 100644 --- a/Neos.Media/Migrations/Postgresql/Version20150131172631.php +++ b/Neos.Media/Migrations/Postgresql/Version20150131172631.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_imagevariant ALTER originalasset SET NOT NULL"); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail ALTER originalasset SET NOT NULL"); @@ -26,9 +27,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_imagevariant ALTER originalasset DROP NOT NULL"); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail ALTER originalasset DROP NOT NULL"); diff --git a/Neos.Media/Migrations/Postgresql/Version20150305113900.php b/Neos.Media/Migrations/Postgresql/Version20150305113900.php index 67916a3bdee..cfae04739f2 100644 --- a/Neos.Media/Migrations/Postgresql/Version20150305113900.php +++ b/Neos.Media/Migrations/Postgresql/Version20150305113900.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_adjustment_abstractimageadjustment ADD position INT NULL"); $this->addSql("UPDATE typo3_media_domain_model_adjustment_abstractimageadjustment SET position = 10 WHERE dtype = 'typo3_media_adjustment_cropimageadjustment'"); @@ -27,9 +28,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_adjustment_abstractimageadjustment DROP position"); } diff --git a/Neos.Media/Migrations/Postgresql/Version20150324185008.php b/Neos.Media/Migrations/Postgresql/Version20150324185008.php index fb4d601420f..d0823861f55 100644 --- a/Neos.Media/Migrations/Postgresql/Version20150324185008.php +++ b/Neos.Media/Migrations/Postgresql/Version20150324185008.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_adjustment_abstractimageadjustment ADD allowupscaling BOOLEAN DEFAULT NULL"); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail ADD allowupscaling BOOLEAN DEFAULT NULL"); @@ -25,9 +26,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_adjustment_abstractimageadjustment DROP allowupscaling"); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail DROP allowupscaling"); diff --git a/Neos.Media/Migrations/Postgresql/Version20150507204451.php b/Neos.Media/Migrations/Postgresql/Version20150507204451.php index ecf92c3fdab..41cbb7512b8 100644 --- a/Neos.Media/Migrations/Postgresql/Version20150507204451.php +++ b/Neos.Media/Migrations/Postgresql/Version20150507204451.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("CREATE TABLE typo3_media_domain_model_assetcollection (persistence_object_identifier VARCHAR(40) NOT NULL, title VARCHAR(255) NOT NULL, PRIMARY KEY(persistence_object_identifier))"); $this->addSql("CREATE TABLE typo3_media_domain_model_assetcollection_assets_join (media_assetcollection VARCHAR(40) NOT NULL, media_asset VARCHAR(40) NOT NULL, PRIMARY KEY(media_assetcollection, media_asset))"); @@ -34,9 +35,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_assetcollection_assets_join DROP CONSTRAINT FK_E90D72512A965871"); $this->addSql("ALTER TABLE typo3_media_domain_model_assetcollection_tags_join DROP CONSTRAINT FK_A41705672A965871"); diff --git a/Neos.Media/Migrations/Postgresql/Version20150701113247.php b/Neos.Media/Migrations/Postgresql/Version20150701113247.php index ac86736fca6..1886d95a591 100644 --- a/Neos.Media/Migrations/Postgresql/Version20150701113247.php +++ b/Neos.Media/Migrations/Postgresql/Version20150701113247.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_image ALTER width DROP NOT NULL"); $this->addSql("ALTER TABLE typo3_media_domain_model_image ALTER height DROP NOT NULL"); @@ -29,9 +30,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_image ALTER width SET NOT NULL"); $this->addSql("ALTER TABLE typo3_media_domain_model_image ALTER height SET NOT NULL"); diff --git a/Neos.Media/Migrations/Postgresql/Version20150913173935.php b/Neos.Media/Migrations/Postgresql/Version20150913173935.php index 28331404b4e..7ade3e4cb29 100644 --- a/Neos.Media/Migrations/Postgresql/Version20150913173935.php +++ b/Neos.Media/Migrations/Postgresql/Version20150913173935.php @@ -1,8 +1,10 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail ADD configuration JSON, ADD configurationhash VARCHAR(32)"); $this->addSql("COMMENT ON COLUMN typo3_media_domain_model_thumbnail.configuration IS '(DC2Type:flow_json_array)'"); $thumbnailResult = $this->connection->executeQuery('SELECT * FROM typo3_media_domain_model_thumbnail'); - while ($thumbnailInfo = $thumbnailResult->fetch(\PDO::FETCH_ASSOC)) { + while ($thumbnailInfo = $thumbnailResult->fetch(PDO::FETCH_ASSOC)) { $configurationArray = array_filter([ 'maximumWidth' => $thumbnailInfo['maximumwidth'], 'maximumHeight' => $thumbnailInfo['maximumheight'], @@ -46,14 +48,14 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail ADD maximumwidth INT DEFAULT NULL, ADD maximumheight INT DEFAULT NULL, ADD ratiomode VARCHAR(255), ADD allowupscaling BOOLEAN"); $thumbnailResult = $this->connection->executeQuery('SELECT * FROM typo3_media_domain_model_thumbnail'); - while ($thumbnailInfo = $thumbnailResult->fetch(\PDO::FETCH_ASSOC)) { + while ($thumbnailInfo = $thumbnailResult->fetch(PDO::FETCH_ASSOC)) { $configuration = json_decode($thumbnailInfo['configuration'], true); $maximumWidth = isset($configuration['maximumWidth']) ? (integer)$configuration['maximumWidth'] : null; $maximumWidth = $maximumWidth === 0 ? null : $maximumWidth; @@ -62,7 +64,7 @@ public function down(Schema $schema): void $ratioMode = isset($configuration['ratioMode']) ? $configuration['ratioMode'] : null; $allowUpScaling = isset($configuration['allowUpScaling']) ? $configuration['allowUpScaling'] : null; $allowUpScaling = $allowUpScaling ? 1 : 0; - $types = [\PDO::PARAM_NULL]; + $types = [PDO::PARAM_NULL]; $this->addSql("UPDATE typo3_media_domain_model_thumbnail SET maximumwidth = ?, maximumheight = ?, ratiomode = ?, allowupscaling = ? WHERE persistence_object_identifier = ?", [$maximumWidth, $maximumHeight, $ratioMode, $allowUpScaling, $thumbnailInfo['persistence_object_identifier']], $types); } diff --git a/Neos.Media/Migrations/Postgresql/Version20151216054040.php b/Neos.Media/Migrations/Postgresql/Version20151216054040.php index f287626096c..754792685af 100644 --- a/Neos.Media/Migrations/Postgresql/Version20151216054040.php +++ b/Neos.Media/Migrations/Postgresql/Version20151216054040.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail ALTER resource DROP NOT NULL"); } @@ -24,9 +25,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail ALTER resource SET NOT NULL"); } diff --git a/Neos.Media/Migrations/Postgresql/Version20151216143845.php b/Neos.Media/Migrations/Postgresql/Version20151216143845.php index a0329927a8e..c7fb445af63 100644 --- a/Neos.Media/Migrations/Postgresql/Version20151216143845.php +++ b/Neos.Media/Migrations/Postgresql/Version20151216143845.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail ADD staticresource VARCHAR(255) DEFAULT NULL"); } @@ -24,9 +25,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail DROP staticresource"); } diff --git a/Neos.Media/Migrations/Postgresql/Version20151216144435.php b/Neos.Media/Migrations/Postgresql/Version20151216144435.php index ce186bb84c4..7ef65658c46 100644 --- a/Neos.Media/Migrations/Postgresql/Version20151216144435.php +++ b/Neos.Media/Migrations/Postgresql/Version20151216144435.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("TRUNCATE TABLE typo3_media_domain_model_thumbnail"); $this->addSql("DROP INDEX originalasset_configurationhash"); @@ -26,9 +27,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("DROP INDEX originalasset_configurationhash"); $this->addSql("CREATE INDEX originalasset_configurationhash ON typo3_media_domain_model_thumbnail (originalasset, configurationhash)"); diff --git a/Neos.Media/Migrations/Postgresql/Version20161125093811.php b/Neos.Media/Migrations/Postgresql/Version20161125093811.php index 33b328eae69..032bbdfc765 100644 --- a/Neos.Media/Migrations/Postgresql/Version20161125093811.php +++ b/Neos.Media/Migrations/Postgresql/Version20161125093811.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE typo3_media_domain_model_adjustment_abstractimageadjustment RENAME TO neos_media_domain_model_adjustment_abstractimageadjustment'); $this->addSql('ALTER TABLE typo3_media_domain_model_asset RENAME TO neos_media_domain_model_asset'); @@ -36,9 +37,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE neos_media_domain_model_adjustment_abstractimageadjustment RENAME TO typo3_media_domain_model_adjustment_abstractimageadjustment'); $this->addSql('ALTER TABLE neos_media_domain_model_asset RENAME TO typo3_media_domain_model_asset'); diff --git a/Neos.Media/Migrations/Postgresql/Version20161125172823.php b/Neos.Media/Migrations/Postgresql/Version20161125172823.php index 332dffe1138..b876e104f11 100644 --- a/Neos.Media/Migrations/Postgresql/Version20161125172823.php +++ b/Neos.Media/Migrations/Postgresql/Version20161125172823.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql("UPDATE neos_media_domain_model_asset SET dtype = REPLACE(dtype, 'typo3_media_', 'neos_media_')"); $this->addSql("UPDATE neos_media_domain_model_adjustment_abstractimageadjustment SET dtype = REPLACE(dtype, 'typo3_media_', 'neos_media_')"); @@ -25,9 +26,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql("UPDATE neos_media_domain_model_asset SET dtype = REPLACE(dtype, 'neos_media_', 'typo3_media_')"); $this->addSql("UPDATE neos_media_domain_model_adjustment_abstractimageadjustment SET dtype = REPLACE(dtype, 'neos_media_', 'typo3_media_')"); diff --git a/Neos.Media/Migrations/Postgresql/Version20170110133136.php b/Neos.Media/Migrations/Postgresql/Version20170110133136.php index 9d032476319..fc45d3ccad1 100644 --- a/Neos.Media/Migrations/Postgresql/Version20170110133136.php +++ b/Neos.Media/Migrations/Postgresql/Version20170110133136.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER INDEX idx_84416fdca76d06e6 RENAME TO IDX_8B2F26F8A76D06E6'); $this->addSql('ALTER INDEX uniq_b8306b8ebc91f416 RENAME TO UNIQ_675F9550BC91F416'); @@ -41,9 +42,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER INDEX uniq_675f9550bc91f416 RENAME TO uniq_b8306b8ebc91f416'); $this->addSql('ALTER INDEX idx_915bc7a21db69eed RENAME TO idx_daf7a1eb1db69eed'); diff --git a/Neos.Media/Migrations/Postgresql/Version20170220155800.php b/Neos.Media/Migrations/Postgresql/Version20170220155800.php index c85caab3c39..ea7a1080974 100644 --- a/Neos.Media/Migrations/Postgresql/Version20170220155800.php +++ b/Neos.Media/Migrations/Postgresql/Version20170220155800.php @@ -1,8 +1,9 @@ abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE neos_media_domain_model_adjustment_abstractimageadjustment ADD quality INT DEFAULT NULL'); $this->addSql('ALTER TABLE neos_media_domain_model_thumbnail ADD quality INT DEFAULT NULL'); } @@ -32,9 +33,9 @@ public function up(Schema $schema): void * @param Schema $schema * @return void */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE neos_media_domain_model_adjustment_abstractimageadjustment DROP quality'); $this->addSql('ALTER TABLE neos_media_domain_model_thumbnail DROP quality'); } diff --git a/Neos.Media/Migrations/Postgresql/Version20180406163142.php b/Neos.Media/Migrations/Postgresql/Version20180406163142.php index 0b07ea38194..8173573de1b 100644 --- a/Neos.Media/Migrations/Postgresql/Version20180406163142.php +++ b/Neos.Media/Migrations/Postgresql/Version20180406163142.php @@ -1,8 +1,10 @@ abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('CREATE TABLE neos_media_domain_model_importedasset (persistence_object_identifier VARCHAR(40) NOT NULL, assetsourceidentifier VARCHAR(255) NOT NULL, remoteassetidentifier VARCHAR(255) NOT NULL, localassetidentifier VARCHAR(255) NOT NULL, localoriginalassetidentifier VARCHAR(255) DEFAULT NULL, importedat TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, PRIMARY KEY(persistence_object_identifier))'); $this->addSql('CREATE UNIQUE INDEX flow_identity_neos_media_domain_model_importedasset ON neos_media_domain_model_importedasset (assetsourceidentifier, remoteassetidentifier, localassetidentifier)'); @@ -34,11 +36,11 @@ public function up(Schema $schema): void /** * @param Schema $schema * @return void - * @throws \Doctrine\DBAL\Migrations\AbortMigrationException + * @throws AbortMigrationException */ - public function down(Schema $schema): void + public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('DROP TABLE neos_media_domain_model_importedasset'); $this->addSql('ALTER TABLE neos_media_domain_model_asset DROP assetsourceidentifier'); diff --git a/Neos.Media/Migrations/Postgresql/Version20181104152204.php b/Neos.Media/Migrations/Postgresql/Version20181104152204.php index 408cd1d9224..0127e629019 100644 --- a/Neos.Media/Migrations/Postgresql/Version20181104152204.php +++ b/Neos.Media/Migrations/Postgresql/Version20181104152204.php @@ -12,7 +12,7 @@ */ use Doctrine\DBAL\Exception as DBALException; -use Doctrine\Migrations\Exception\AbortMigration as AbortMigrationException; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; @@ -35,7 +35,7 @@ public function getDescription(): string public function up(Schema $schema): void { // this up() migration is autogenerated, please modify it to your needs - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE neos_media_domain_model_asset ADD copyrightnotice TEXT NOT NULL DEFAULT \'\''); } @@ -48,7 +48,7 @@ public function up(Schema $schema): void public function down(Schema $schema): void { // this down() migration is autogenerated, please modify it to your needs - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE neos_media_domain_model_asset DROP copyrightnotice'); } diff --git a/Neos.Media/Migrations/Postgresql/Version20190314150745.php b/Neos.Media/Migrations/Postgresql/Version20190314150745.php index 89d1edb27a9..83ca279b2b4 100644 --- a/Neos.Media/Migrations/Postgresql/Version20190314150745.php +++ b/Neos.Media/Migrations/Postgresql/Version20190314150745.php @@ -1,8 +1,10 @@ abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); // It is now safe the remove the default value from the database schema, as we only needed it during migration of earlier Neos versions: $this->addSql('ALTER TABLE neos_media_domain_model_asset ALTER assetsourceidentifier DROP DEFAULT'); @@ -42,11 +44,11 @@ public function up(Schema $schema): void /** * @param Schema $schema * @return void - * @throws \Doctrine\DBAL\Exception + * @throws Exception */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE neos_media_domain_model_asset ALTER assetsourceidentifier SET DEFAULT \'neos\''); $this->addSql('ALTER TABLE neos_media_domain_model_asset ALTER assetsourceidentifier DROP NOT NULL'); diff --git a/Neos.Media/Migrations/Postgresql/Version20190315122901.php b/Neos.Media/Migrations/Postgresql/Version20190315122901.php index 483de8c81f5..be9f4096126 100644 --- a/Neos.Media/Migrations/Postgresql/Version20190315122901.php +++ b/Neos.Media/Migrations/Postgresql/Version20190315122901.php @@ -2,7 +2,7 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; use Doctrine\DBAL\Exception as DBALException; -use Doctrine\Migrations\Exception\AbortMigration as AbortMigrationException; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; @@ -27,7 +27,7 @@ public function getDescription(): string */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE neos_media_domain_model_adjustment_abstractimageadjustment ADD aspectratioasstring VARCHAR(255) DEFAULT NULL'); } @@ -38,7 +38,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE neos_media_domain_model_adjustment_abstractimageadjustment DROP aspectratioasstring'); } } diff --git a/Neos.Media/Migrations/Postgresql/Version20191125132701.php b/Neos.Media/Migrations/Postgresql/Version20191125132701.php index 13216f4e17c..72cac2e417b 100644 --- a/Neos.Media/Migrations/Postgresql/Version20191125132701.php +++ b/Neos.Media/Migrations/Postgresql/Version20191125132701.php @@ -4,9 +4,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; use Doctrine\DBAL\Exception as DBALException; -use Doctrine\Migrations\Exception\AbortMigration as AbortMigrationException; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Set default for ratio mode for image adjustments @@ -29,7 +29,7 @@ public function getDescription(): string */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('UPDATE neos_media_domain_model_adjustment_abstractimageadjustment SET ratiomode=\'inset\' WHERE ratiomode IS NULL AND dtype=\'neos_media_adjustment_resizeimageadjustment\''); } @@ -40,6 +40,6 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); } } diff --git a/Neos.Media/Migrations/Postgresql/Version20200307122055.php b/Neos.Media/Migrations/Postgresql/Version20200307122055.php index 996ef5893f0..0d9929808c7 100644 --- a/Neos.Media/Migrations/Postgresql/Version20200307122055.php +++ b/Neos.Media/Migrations/Postgresql/Version20200307122055.php @@ -2,9 +2,10 @@ declare(strict_types=1); namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Exception; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; -use Doctrine\Migrations\Exception\AbortMigration as AbortMigrationException; +use Doctrine\Migrations\AbstractMigration; class Version20200307122055 extends AbstractMigration { @@ -20,12 +21,12 @@ public function getDescription(): string /** * @param Schema $schema * @return void - * @throws \Doctrine\DBAL\Exception + * @throws Exception */ public function up(Schema $schema): void { // this up() migration is autogenerated, please modify it to your needs - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE neos_media_domain_model_tag ADD parent VARCHAR(40) DEFAULT NULL'); $this->addSql('ALTER TABLE neos_media_domain_model_tag ADD CONSTRAINT FK_CA4889693D8E604F FOREIGN KEY (parent) REFERENCES neos_media_domain_model_tag (persistence_object_identifier) ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE'); @@ -35,12 +36,12 @@ public function up(Schema $schema): void /** * @param Schema $schema * @return void - * @throws \Doctrine\DBAL\Exception + * @throws Exception */ public function down(Schema $schema): void { // this down() migration is autogenerated, please modify it to your needs - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE neos_media_domain_model_tag DROP CONSTRAINT FK_CA4889693D8E604F'); $this->addSql('DROP INDEX IDX_CA4889693D8E604F'); $this->addSql('ALTER TABLE neos_media_domain_model_tag DROP parent'); diff --git a/Neos.Media/Migrations/Postgresql/Version20200823164701.php b/Neos.Media/Migrations/Postgresql/Version20200823164701.php index 29ce1128305..ea6b547b796 100644 --- a/Neos.Media/Migrations/Postgresql/Version20200823164701.php +++ b/Neos.Media/Migrations/Postgresql/Version20200823164701.php @@ -4,7 +4,7 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; use Doctrine\DBAL\Exception as DBALException; -use Doctrine\Migrations\Exception\AbortMigration as AbortMigrationException; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; @@ -32,7 +32,7 @@ public function getDescription(): string */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); foreach (self::TYPES as $type) { $this->addSql(sprintf( @@ -50,7 +50,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); foreach (self::TYPES as $type) { $this->addSql(sprintf( diff --git a/Neos.Media/Migrations/Postgresql/Version20200828170101.php b/Neos.Media/Migrations/Postgresql/Version20200828170101.php index 61b56560a9b..1f0363d3471 100644 --- a/Neos.Media/Migrations/Postgresql/Version20200828170101.php +++ b/Neos.Media/Migrations/Postgresql/Version20200828170101.php @@ -4,7 +4,7 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; use Doctrine\DBAL\Exception as DBALException; -use Doctrine\Migrations\Exception\AbortMigration as AbortMigrationException; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; @@ -28,7 +28,7 @@ public function getDescription(): string */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql("UPDATE neos_media_domain_model_thumbnail SET staticresource = REPLACE(staticresource, 'resource://TYPO3.Media/Public/Icons/512px/', 'resource://Neos.Media/Public/IconSets/vivid/')"); $this->addSql("UPDATE neos_media_domain_model_thumbnail SET staticresource = REPLACE(staticresource, '.png', '.svg')"); @@ -41,7 +41,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql("UPDATE neos_media_domain_model_thumbnail SET staticresource = REPLACE(staticresource, 'resource://Neos.Media/Public/IconSets/vivid/', 'resource://TYPO3.Media/Public/Icons/512px/')"); $this->addSql("UPDATE neos_media_domain_model_thumbnail SET staticresource = REPLACE(staticresource, '.svg', '.png')"); diff --git a/Neos.Neos/Migrations/Mysql/Version20110620155002.php b/Neos.Neos/Migrations/Mysql/Version20110620155002.php index e84eaaa7b9b..cb3eb893b92 100644 --- a/Neos.Neos/Migrations/Mysql/Version20110620155002.php +++ b/Neos.Neos/Migrations/Mysql/Version20110620155002.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Database structure as per the T3CON11 CfP launch on 2011-05-20 @@ -16,7 +17,7 @@ class Version20110620155002 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("CREATE TABLE typo3_domain (flow3_persistence_identifier VARCHAR(40) NOT NULL, typo3_site VARCHAR(40) DEFAULT NULL, hostpattern VARCHAR(255) DEFAULT NULL, INDEX IDX_64D1A917E12C6E67 (typo3_site), PRIMARY KEY(flow3_persistence_identifier)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB"); $this->addSql("CREATE TABLE typo3_site (flow3_persistence_identifier VARCHAR(40) NOT NULL, name VARCHAR(255) DEFAULT NULL, nodename VARCHAR(255) DEFAULT NULL, state INT DEFAULT NULL, siteresourcespackagekey VARCHAR(255) DEFAULT NULL, PRIMARY KEY(flow3_persistence_identifier)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB"); @@ -33,7 +34,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_user DROP FOREIGN KEY typo3_user_ibfk_2"); $this->addSql("ALTER TABLE typo3_user DROP FOREIGN KEY typo3_user_ibfk_1"); diff --git a/Neos.Neos/Migrations/Mysql/Version20110824125035.php b/Neos.Neos/Migrations/Mysql/Version20110824125035.php index 29f7349406f..e48935a437f 100644 --- a/Neos.Neos/Migrations/Mysql/Version20110824125035.php +++ b/Neos.Neos/Migrations/Mysql/Version20110824125035.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Rename TYPO3 tables to follow FQCN @@ -16,7 +17,7 @@ class Version20110824125035 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("RENAME TABLE typo3_domain TO typo3_typo3_domain_model_domain"); $this->addSql("RENAME TABLE typo3_site TO typo3_typo3_domain_model_site"); @@ -30,7 +31,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("RENAME TABLE typo3_typo3_domain_model_domain TO typo3_domain"); $this->addSql("RENAME TABLE typo3_typo3_domain_model_site TO typo3_site"); diff --git a/Neos.Neos/Migrations/Mysql/Version20110919164835.php b/Neos.Neos/Migrations/Mysql/Version20110919164835.php index 030a5f2c1d2..cd58f991b5d 100644 --- a/Neos.Neos/Migrations/Mysql/Version20110919164835.php +++ b/Neos.Neos/Migrations/Mysql/Version20110919164835.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Creates the table for the TYPO3 Media\Image model @@ -16,7 +17,7 @@ class Version20110919164835 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("CREATE TABLE typo3_typo3_domain_model_media_image (flow3_persistence_identifier VARCHAR(40) NOT NULL, flow3_resource_resource VARCHAR(40) DEFAULT NULL, UNIQUE INDEX UNIQ_E5EA82E211FFD19F (flow3_resource_resource), PRIMARY KEY(flow3_persistence_identifier)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB"); $this->addSql("ALTER TABLE typo3_typo3_domain_model_media_image ADD CONSTRAINT typo3_typo3_domain_model_media_image_ibfk_1 FOREIGN KEY (flow3_resource_resource) REFERENCES typo3_flow3_resource_resource(flow3_persistence_identifier)"); @@ -28,7 +29,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("DROP TABLE typo3_typo3_domain_model_media_image"); } diff --git a/Neos.Neos/Migrations/Mysql/Version20110923125538.php b/Neos.Neos/Migrations/Mysql/Version20110923125538.php index 148a6933ef7..ebb44f764b4 100644 --- a/Neos.Neos/Migrations/Mysql/Version20110923125538.php +++ b/Neos.Neos/Migrations/Mysql/Version20110923125538.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Fix column names for direct associations @@ -16,7 +17,7 @@ class Version20110923125538 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_typo3_domain_model_domain DROP FOREIGN KEY typo3_typo3_domain_model_domain_ibfk_1"); $this->addSql("DROP INDEX IDX_64D1A917E12C6E67 ON typo3_typo3_domain_model_domain"); @@ -43,7 +44,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_typo3_domain_model_domain DROP FOREIGN KEY typo3_typo3_domain_model_domain_ibfk_1"); $this->addSql("DROP INDEX IDX_F227E8F6694309E4 ON typo3_typo3_domain_model_domain"); diff --git a/Neos.Neos/Migrations/Mysql/Version20110925123119.php b/Neos.Neos/Migrations/Mysql/Version20110925123119.php index b26c459af70..e1e1b5857a4 100644 --- a/Neos.Neos/Migrations/Mysql/Version20110925123119.php +++ b/Neos.Neos/Migrations/Mysql/Version20110925123119.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Drop media image tables of TYPO3 package, no longer used @@ -17,7 +18,7 @@ class Version20110925123119 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("DROP TABLE typo3_typo3_domain_model_media_image"); } @@ -28,7 +29,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("CREATE TABLE typo3_typo3_domain_model_media_image (flow3_persistence_identifier VARCHAR(40) NOT NULL, resource VARCHAR(40) DEFAULT NULL, UNIQUE INDEX UNIQ_E5EA82E2BC91F416 (resource), PRIMARY KEY(flow3_persistence_identifier)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB"); $this->addSql("ALTER TABLE typo3_typo3_domain_model_media_image ADD CONSTRAINT typo3_typo3_domain_model_media_image_ibfk_1 FOREIGN KEY (resource) REFERENCES typo3_flow3_resource_resource(flow3_persistence_identifier)"); diff --git a/Neos.Neos/Migrations/Mysql/Version20120329220343.php b/Neos.Neos/Migrations/Mysql/Version20120329220343.php index 93c274738fb..7f138f8c69d 100644 --- a/Neos.Neos/Migrations/Mysql/Version20120329220343.php +++ b/Neos.Neos/Migrations/Mysql/Version20120329220343.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Adjust default values to NOT NULL unless allowed in model. @@ -16,7 +17,7 @@ class Version20120329220343 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_typo3_domain_model_domain CHANGE hostpattern hostpattern VARCHAR(255) NOT NULL"); $this->addSql("ALTER TABLE typo3_typo3_domain_model_site CHANGE name name VARCHAR(255) NOT NULL, CHANGE nodename nodename VARCHAR(255) NOT NULL, CHANGE state state INT NOT NULL, CHANGE siteresourcespackagekey siteresourcespackagekey VARCHAR(255) NOT NULL"); @@ -29,7 +30,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_typo3_domain_model_domain CHANGE hostpattern hostpattern VARCHAR(255) DEFAULT NULL"); $this->addSql("ALTER TABLE typo3_typo3_domain_model_site CHANGE name name VARCHAR(255) DEFAULT NULL, CHANGE nodename nodename VARCHAR(255) DEFAULT NULL, CHANGE state state INT DEFAULT NULL, CHANGE siteresourcespackagekey siteresourcespackagekey VARCHAR(255) DEFAULT NULL"); diff --git a/Neos.Neos/Migrations/Mysql/Version20120429213448.php b/Neos.Neos/Migrations/Mysql/Version20120429213448.php index 4077c985cc7..13a0c059b69 100644 --- a/Neos.Neos/Migrations/Mysql/Version20120429213448.php +++ b/Neos.Neos/Migrations/Mysql/Version20120429213448.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Create unique indexes for identity properties @@ -16,7 +17,7 @@ class Version20120429213448 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("CREATE UNIQUE INDEX flow3_identity_typo3_typo3_domain_model_site ON typo3_typo3_domain_model_site (nodename)"); } @@ -27,7 +28,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("DROP INDEX flow3_identity_typo3_typo3_domain_model_site ON typo3_typo3_domain_model_site"); } diff --git a/Neos.Neos/Migrations/Mysql/Version20121001202223.php b/Neos.Neos/Migrations/Mysql/Version20121001202223.php index 6d22848a88d..f99f6395df3 100644 --- a/Neos.Neos/Migrations/Mysql/Version20121001202223.php +++ b/Neos.Neos/Migrations/Mysql/Version20121001202223.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; use Neos\Flow\Persistence\Doctrine\Service; /** @@ -17,7 +18,7 @@ class Version20121001202223 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); // collect foreign keys pointing to "our" tables $tableNames = array( @@ -59,7 +60,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); // collect foreign keys pointing to "our" tables $tableNames = array( diff --git a/Neos.Neos/Migrations/Mysql/Version20121030221151.php b/Neos.Neos/Migrations/Mysql/Version20121030221151.php index bd26bc671d8..968c89f9f80 100644 --- a/Neos.Neos/Migrations/Mysql/Version20121030221151.php +++ b/Neos.Neos/Migrations/Mysql/Version20121030221151.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Rename from TYPO3 and/or Phoenix to Neos as needed @@ -16,7 +17,7 @@ class Version20121030221151 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_typo3_domain_model_site RENAME TO typo3_neos_domain_model_site"); $this->addSql("ALTER TABLE typo3_typo3_domain_model_domain RENAME TO typo3_neos_domain_model_domain"); @@ -38,7 +39,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_neos_domain_model_site RENAME TO typo3_typo3_domain_model_site"); $this->addSql("ALTER TABLE typo3_neos_domain_model_domain RENAME TO typo3_typo3_domain_model_domain"); diff --git a/Neos.Neos/Migrations/Mysql/Version20121031190213.php b/Neos.Neos/Migrations/Mysql/Version20121031190213.php index 90bb1c56808..1fdd5d0ee5e 100644 --- a/Neos.Neos/Migrations/Mysql/Version20121031190213.php +++ b/Neos.Neos/Migrations/Mysql/Version20121031190213.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Add state field to the "Domain" domain model schema @@ -16,7 +17,7 @@ class Version20121031190213 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_neos_domain_model_domain ADD active TINYINT(1) NOT NULL"); } @@ -27,7 +28,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_neos_domain_model_domain DROP active"); } diff --git a/Neos.Neos/Migrations/Mysql/Version20130213130515.php b/Neos.Neos/Migrations/Mysql/Version20130213130515.php index 5c14c81fe7d..9760aeee2ba 100644 --- a/Neos.Neos/Migrations/Mysql/Version20130213130515.php +++ b/Neos.Neos/Migrations/Mysql/Version20130213130515.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Create unique indexes for identity properties @@ -16,7 +17,7 @@ class Version20130213130515 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("CREATE UNIQUE INDEX flow_identity_typo3_neos_domain_model_domain ON typo3_neos_domain_model_domain (hostpattern)"); } @@ -27,7 +28,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("DROP INDEX flow_identity_typo3_neos_domain_model_domain ON typo3_neos_domain_model_domain"); } diff --git a/Neos.Neos/Migrations/Mysql/Version20131111235827.php b/Neos.Neos/Migrations/Mysql/Version20131111235827.php index eff5799e818..8ab2b6d490a 100644 --- a/Neos.Neos/Migrations/Mysql/Version20131111235827.php +++ b/Neos.Neos/Migrations/Mysql/Version20131111235827.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Remove the site content object proxy from all site nodes and change their node type to "TYPO3.Neos:Shortcut" @@ -16,7 +17,7 @@ class Version20131111235827 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_nodedata']); if ($hasTables) { @@ -30,7 +31,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_nodedata']); if ($hasTables) { diff --git a/Neos.Neos/Migrations/Mysql/Version20141017174559.php b/Neos.Neos/Migrations/Mysql/Version20141017174559.php index 886738c9a9f..17793fe65ba 100644 --- a/Neos.Neos/Migrations/Mysql/Version20141017174559.php +++ b/Neos.Neos/Migrations/Mysql/Version20141017174559.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Change all existing serialized ImageVariants to arrays to be picked up and converted by the matching ContentRepository migration. @@ -16,7 +17,7 @@ class Version20141017174559 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_nodedata']); if ($hasTables) { @@ -30,7 +31,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->write('The conversion of nodes to the new resource management cannot be reverted with a database migration.'); } } diff --git a/Neos.Neos/Migrations/Mysql/Version20141114115241.php b/Neos.Neos/Migrations/Mysql/Version20141114115241.php index 668c6c91f8b..28769cfd8fd 100644 --- a/Neos.Neos/Migrations/Mysql/Version20141114115241.php +++ b/Neos.Neos/Migrations/Mysql/Version20141114115241.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Create Event Log Table @@ -16,7 +17,7 @@ class Version20141114115241 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("CREATE TABLE typo3_neos_eventlog_domain_model_event (persistence_object_identifier VARCHAR(40) NOT NULL, parentevent VARCHAR(40) DEFAULT NULL, timestamp DATETIME NOT NULL, uid INT(11) NOT NULL AUTO_INCREMENT UNIQUE, eventtype VARCHAR(255) NOT NULL, accountidentifier VARCHAR(255) DEFAULT NULL, data LONGTEXT NOT NULL COMMENT '(DC2Type:array)', dtype VARCHAR(255) NOT NULL, nodeidentifier VARCHAR(255) DEFAULT NULL, documentnodeidentifier VARCHAR(255) DEFAULT NULL, workspacename VARCHAR(255) DEFAULT NULL, dimension LONGTEXT DEFAULT NULL COMMENT '(DC2Type:array)', INDEX IDX_30AB3A75B684C08 (parentevent), PRIMARY KEY(persistence_object_identifier)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB"); $this->addSql("ALTER TABLE typo3_neos_eventlog_domain_model_event ADD CONSTRAINT FK_30AB3A75B684C08 FOREIGN KEY (parentevent) REFERENCES typo3_neos_eventlog_domain_model_event (persistence_object_identifier)"); @@ -28,7 +29,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_neos_eventlog_domain_model_event DROP FOREIGN KEY FK_30AB3A75B684C08"); $this->addSql("DROP TABLE typo3_neos_eventlog_domain_model_event"); diff --git a/Neos.Neos/Migrations/Mysql/Version20150224171107.php b/Neos.Neos/Migrations/Mysql/Version20150224171107.php index e5597c52e8d..216966c1fa3 100644 --- a/Neos.Neos/Migrations/Mysql/Version20150224171107.php +++ b/Neos.Neos/Migrations/Mysql/Version20150224171107.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Adjust event log table to schema valid table structure @@ -16,7 +17,7 @@ class Version20150224171107 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_neos_eventlog_domain_model_event DROP FOREIGN KEY FK_30AB3A75B684C08"); $this->addSql("ALTER TABLE typo3_neos_eventlog_domain_model_event DROP PRIMARY KEY"); @@ -39,7 +40,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_neos_eventlog_domain_model_event DROP FOREIGN KEY FK_30AB3A75B684C08"); $this->addSql("ALTER TABLE typo3_neos_eventlog_domain_model_event DROP PRIMARY KEY"); diff --git a/Neos.Neos/Migrations/Mysql/Version20150309215317.php b/Neos.Neos/Migrations/Mysql/Version20150309215317.php index 496cd868f13..3849e2322f5 100644 --- a/Neos.Neos/Migrations/Mysql/Version20150309215317.php +++ b/Neos.Neos/Migrations/Mysql/Version20150309215317.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Adjust DB schema to a clean state (remove cruft that built up in the past) @@ -16,7 +17,7 @@ class Version20150309215317 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $indexes = $this->sm->listTableIndexes('typo3_neos_domain_model_domain'); if (array_key_exists('idx_f227e8f6694309e4', $indexes)) { @@ -49,7 +50,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("CREATE UNIQUE INDEX uid ON typo3_neos_eventlog_domain_model_event (uid)"); diff --git a/Neos.Neos/Migrations/Mysql/Version20150507204452.php b/Neos.Neos/Migrations/Mysql/Version20150507204452.php index 9ef33cc701e..29046cd154a 100644 --- a/Neos.Neos/Migrations/Mysql/Version20150507204452.php +++ b/Neos.Neos/Migrations/Mysql/Version20150507204452.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Add asset collection to site @@ -16,7 +17,7 @@ class Version20150507204452 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_neos_domain_model_site ADD assetcollection VARCHAR(40) DEFAULT NULL"); $this->addSql("ALTER TABLE typo3_neos_domain_model_site ADD CONSTRAINT FK_1854B2075CEB2C15 FOREIGN KEY (assetcollection) REFERENCES typo3_media_domain_model_assetcollection (persistence_object_identifier)"); @@ -29,7 +30,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_neos_domain_model_site DROP FOREIGN KEY FK_1854B2075CEB2C15"); $this->addSql("DROP INDEX IDX_1854B2075CEB2C15 ON typo3_neos_domain_model_site"); diff --git a/Neos.Neos/Migrations/Mysql/Version20150724091148.php b/Neos.Neos/Migrations/Mysql/Version20150724091148.php index 13220b18a82..f440b65121e 100644 --- a/Neos.Neos/Migrations/Mysql/Version20150724091148.php +++ b/Neos.Neos/Migrations/Mysql/Version20150724091148.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Adds indices to the event log to improve performance @@ -16,7 +17,7 @@ class Version20150724091148 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("CREATE INDEX documentnodeidentifier ON typo3_neos_eventlog_domain_model_event (documentnodeidentifier)"); $this->addSql("CREATE INDEX eventtype ON typo3_neos_eventlog_domain_model_event (eventtype)"); @@ -28,7 +29,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("DROP INDEX documentnodeidentifier ON typo3_neos_eventlog_domain_model_event"); $this->addSql("DROP INDEX eventtype ON typo3_neos_eventlog_domain_model_event"); diff --git a/Neos.Neos/Migrations/Mysql/Version20151117125551.php b/Neos.Neos/Migrations/Mysql/Version20151117125551.php index f23dffcf634..da221d94cff 100644 --- a/Neos.Neos/Migrations/Mysql/Version20151117125551.php +++ b/Neos.Neos/Migrations/Mysql/Version20151117125551.php @@ -2,8 +2,10 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; +use PDO; /** * Set the Workspace "owner" field for all personal workspaces @@ -16,24 +18,24 @@ class Version20151117125551 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_workspace']); if ($hasTables) { $workspacesQuery = $this->connection->executeQuery('SELECT name FROM typo3_typo3cr_domain_model_workspace t0 WHERE t0.name LIKE \'user-%\' AND t0.owner IS NULL'); - while ($workspaceRecord = $workspacesQuery->fetch(\PDO::FETCH_ASSOC)) { + while ($workspaceRecord = $workspacesQuery->fetch(PDO::FETCH_ASSOC)) { $username = substr($workspaceRecord['name'], 5); $accountQuery = $this->connection->executeQuery('SELECT persistence_object_identifier FROM typo3_flow_security_account t0 WHERE t0.accountidentifier = \'' . $username . '\' AND t0.authenticationprovidername = \'Typo3BackendProvider\''); - $accountRecord = $accountQuery->fetch(\PDO::FETCH_ASSOC); + $accountRecord = $accountQuery->fetch(PDO::FETCH_ASSOC); $partyQuery = $this->connection->executeQuery('SELECT party_abstractparty FROM typo3_party_domain_model_abstractparty_accounts_join t0 WHERE t0.flow_security_account = \'' . $accountRecord['persistence_object_identifier'] . '\''); - $partyRecord = $partyQuery->fetch(\PDO::FETCH_ASSOC); + $partyRecord = $partyQuery->fetch(PDO::FETCH_ASSOC); $this->addSql('UPDATE typo3_typo3cr_domain_model_workspace SET owner = \'' . $partyRecord['party_abstractparty'] . '\' WHERE name = \'user-' . $username . '\''); @@ -47,7 +49,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_workspace']); if ($hasTables) { diff --git a/Neos.Neos/Migrations/Mysql/Version20151223125909.php b/Neos.Neos/Migrations/Mysql/Version20151223125909.php index 86556582ca8..3e7b2c61bfc 100644 --- a/Neos.Neos/Migrations/Mysql/Version20151223125909.php +++ b/Neos.Neos/Migrations/Mysql/Version20151223125909.php @@ -2,9 +2,11 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; use Neos\Neos\Utility\User as UserUtility; +use PDO; /** * Set the Workspace "owner" field for all personal workspaces with special characters in the username @@ -17,21 +19,21 @@ class Version20151223125909 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_workspace']); if ($hasTables) { $workspacesWithoutOwnerQuery = $this->connection->executeQuery('SELECT name FROM typo3_typo3cr_domain_model_workspace t0 WHERE t0.name LIKE \'user-%\' AND t0.owner IS NULL'); - $workspacesWithoutOwner = $workspacesWithoutOwnerQuery->fetchAll(\PDO::FETCH_ASSOC); + $workspacesWithoutOwner = $workspacesWithoutOwnerQuery->fetchAll(PDO::FETCH_ASSOC); if ($workspacesWithoutOwner === []) { return; } $neosAccountQuery = $this->connection->executeQuery('SELECT t0.party_abstractparty, t1.accountidentifier FROM typo3_party_domain_model_abstractparty_accounts_join t0 JOIN typo3_flow_security_account t1 ON t0.flow_security_account = t1.persistence_object_identifier WHERE t1.authenticationprovidername = \'Typo3BackendProvider\''); - while ($account = $neosAccountQuery->fetch(\PDO::FETCH_ASSOC)) { + while ($account = $neosAccountQuery->fetch(PDO::FETCH_ASSOC)) { $normalizedUsername = UserUtility::slugifyUsername($account['accountidentifier']); foreach ($workspacesWithoutOwner as $workspaceWithoutOwner) { @@ -51,7 +53,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_workspace']); if ($hasTables) { diff --git a/Neos.Neos/Migrations/Mysql/Version20160104121311.php b/Neos.Neos/Migrations/Mysql/Version20160104121311.php index 85b45deacf5..d18a45b32b6 100644 --- a/Neos.Neos/Migrations/Mysql/Version20160104121311.php +++ b/Neos.Neos/Migrations/Mysql/Version20160104121311.php @@ -2,9 +2,11 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; use Neos\Neos\Utility\User as UserUtility; +use PDO; /** * Set the Workspace "owner" field for all personal workspaces with special characters in the username @@ -17,21 +19,21 @@ class Version20160104121311 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_workspace']); if ($hasTables) { $workspacesWithoutOwnerQuery = $this->connection->executeQuery("SELECT name FROM typo3_typo3cr_domain_model_workspace t0 WHERE t0.name LIKE 'user-%' AND t0.owner = ''"); - $workspacesWithoutOwner = $workspacesWithoutOwnerQuery->fetchAll(\PDO::FETCH_ASSOC); + $workspacesWithoutOwner = $workspacesWithoutOwnerQuery->fetchAll(PDO::FETCH_ASSOC); if ($workspacesWithoutOwner === []) { return; } $neosAccountQuery = $this->connection->executeQuery('SELECT t0.party_abstractparty, t1.accountidentifier FROM typo3_party_domain_model_abstractparty_accounts_join t0 JOIN typo3_flow_security_account t1 ON t0.flow_security_account = t1.persistence_object_identifier WHERE t1.authenticationprovidername = \'Typo3BackendProvider\''); - while ($account = $neosAccountQuery->fetch(\PDO::FETCH_ASSOC)) { + while ($account = $neosAccountQuery->fetch(PDO::FETCH_ASSOC)) { $normalizedUsername = UserUtility::slugifyUsername($account['accountidentifier']); foreach ($workspacesWithoutOwner as $workspaceWithoutOwner) { @@ -51,7 +53,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_workspace']); if ($hasTables) { diff --git a/Neos.Neos/Migrations/Mysql/Version20160212141523.php b/Neos.Neos/Migrations/Mysql/Version20160212141523.php index 0235410f9b9..37018c0d842 100644 --- a/Neos.Neos/Migrations/Mysql/Version20160212141523.php +++ b/Neos.Neos/Migrations/Mysql/Version20160212141523.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Adjust some (old) index names to current Doctrine DBAL behavior (see https://jira.neos.io/browse/FLOW-427) @@ -16,7 +17,7 @@ class Version20160212141523 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $indexes = $this->sm->listTableIndexes('typo3_neos_domain_model_domain'); if (array_key_exists('idx_f227e8f6694309e4', $indexes)) { @@ -45,7 +46,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $indexes = $this->sm->listTableIndexes('typo3_neos_domain_model_domain'); if (array_key_exists('idx_8e49a537694309e4', $indexes)) { diff --git a/Neos.Neos/Migrations/Mysql/Version20160223165603.php b/Neos.Neos/Migrations/Mysql/Version20160223165603.php index a849b33a56a..35b6dc72ebe 100644 --- a/Neos.Neos/Migrations/Mysql/Version20160223165603.php +++ b/Neos.Neos/Migrations/Mysql/Version20160223165603.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Adjust column comment to type change @@ -16,7 +17,7 @@ class Version20160223165603 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_neos_eventlog_domain_model_event CHANGE data data LONGTEXT NOT NULL COMMENT '(DC2Type:flow_json_array)'"); } @@ -27,7 +28,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform)); $this->addSql("ALTER TABLE typo3_neos_eventlog_domain_model_event CHANGE data data LONGTEXT NOT NULL COMMENT '(DC2Type:array)'"); } diff --git a/Neos.Neos/Migrations/Mysql/Version20160411101457.php b/Neos.Neos/Migrations/Mysql/Version20160411101457.php index aef7fd6c498..ce274cd8932 100644 --- a/Neos.Neos/Migrations/Mysql/Version20160411101457.php +++ b/Neos.Neos/Migrations/Mysql/Version20160411101457.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Adds scheme and port to domain model @@ -16,7 +17,7 @@ class Version20160411101457 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('ALTER TABLE typo3_neos_domain_model_domain ADD scheme VARCHAR(255) DEFAULT NULL, ADD port INT DEFAULT NULL'); } @@ -27,7 +28,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('ALTER TABLE typo3_neos_domain_model_domain DROP scheme, DROP port'); } diff --git a/Neos.Neos/Migrations/Mysql/Version20160411101458.php b/Neos.Neos/Migrations/Mysql/Version20160411101458.php index 8cfce2d0f32..feca2c2c7d7 100644 --- a/Neos.Neos/Migrations/Mysql/Version20160411101458.php +++ b/Neos.Neos/Migrations/Mysql/Version20160411101458.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Adds primary domain to site model @@ -16,7 +17,7 @@ class Version20160411101458 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('ALTER TABLE typo3_neos_domain_model_site ADD primarydomain VARCHAR(40) DEFAULT NULL'); $this->addSql('ALTER TABLE typo3_neos_domain_model_site ADD CONSTRAINT FK_1854B207B8872B4A FOREIGN KEY (primarydomain) REFERENCES typo3_neos_domain_model_domain (persistence_object_identifier)'); @@ -29,7 +30,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('ALTER TABLE typo3_neos_domain_model_site DROP FOREIGN KEY FK_1854B207B8872B4A'); $this->addSql('DROP INDEX IDX_1854B207B8872B4A ON typo3_neos_domain_model_site'); diff --git a/Neos.Neos/Migrations/Mysql/Version20160711103441.php b/Neos.Neos/Migrations/Mysql/Version20160711103441.php index 218efbcb00e..15b371a0fbc 100644 --- a/Neos.Neos/Migrations/Mysql/Version20160711103441.php +++ b/Neos.Neos/Migrations/Mysql/Version20160711103441.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Rename hostpattern to hostname @@ -24,7 +25,7 @@ public function getDescription(): string */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('DROP INDEX flow_identity_typo3_neos_domain_model_domain ON typo3_neos_domain_model_domain'); $this->addSql('ALTER TABLE typo3_neos_domain_model_domain CHANGE hostpattern hostname VARCHAR(255) NOT NULL'); @@ -37,7 +38,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('DROP INDEX flow_identity_typo3_neos_domain_model_domain ON typo3_neos_domain_model_domain'); $this->addSql('ALTER TABLE typo3_neos_domain_model_domain CHANGE hostname hostpattern VARCHAR(255) NOT NULL COLLATE utf8mb4_unicode_ci'); diff --git a/Neos.Neos/Migrations/Mysql/Version20161125093800.php b/Neos.Neos/Migrations/Mysql/Version20161125093800.php index 723f3b9a77b..c7e30ca3767 100644 --- a/Neos.Neos/Migrations/Mysql/Version20161125093800.php +++ b/Neos.Neos/Migrations/Mysql/Version20161125093800.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Adjust table names to the renaming of TYPO3.Neos to Neos.Neos. @@ -16,7 +17,7 @@ class Version20161125093800 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('RENAME TABLE typo3_neos_domain_model_domain TO neos_neos_domain_model_domain'); $this->addSql('RENAME TABLE typo3_neos_domain_model_site TO neos_neos_domain_model_site'); @@ -31,7 +32,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('RENAME TABLE neos_neos_domain_model_domain TO typo3_neos_domain_model_domain'); $this->addSql('RENAME TABLE neos_neos_domain_model_site TO typo3_neos_domain_model_site'); diff --git a/Neos.Neos/Migrations/Mysql/Version20161125124749.php b/Neos.Neos/Migrations/Mysql/Version20161125124749.php index 7f6f9e9d5d9..0a2b847efa4 100644 --- a/Neos.Neos/Migrations/Mysql/Version20161125124749.php +++ b/Neos.Neos/Migrations/Mysql/Version20161125124749.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Rename node names in neos_contentrepository_domain_model_nodedata @@ -16,7 +17,7 @@ class Version20161125124749 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['neos_contentrepository_domain_model_nodedata']); @@ -37,7 +38,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['neos_contentrepository_domain_model_nodedata']); diff --git a/Neos.Neos/Migrations/Mysql/Version20161125171231.php b/Neos.Neos/Migrations/Mysql/Version20161125171231.php index 0500fbbb728..168bc7e3487 100644 --- a/Neos.Neos/Migrations/Mysql/Version20161125171231.php +++ b/Neos.Neos/Migrations/Mysql/Version20161125171231.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Rename dtypes in neos_neos_eventlog_domain_model_event @@ -16,7 +17,7 @@ class Version20161125171231 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql("UPDATE neos_neos_eventlog_domain_model_event SET dtype = REPLACE(dtype, 'typo3_neos_', 'neos_neos_')"); } @@ -27,7 +28,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql("UPDATE neos_neos_eventlog_domain_model_event SET dtype = REPLACE(dtype, 'neos_neos_', 'typo3_neos_')"); } diff --git a/Neos.Neos/Migrations/Mysql/Version20170110130253.php b/Neos.Neos/Migrations/Mysql/Version20170110130253.php index 84e3b7120aa..58283f5b70c 100644 --- a/Neos.Neos/Migrations/Mysql/Version20170110130253.php +++ b/Neos.Neos/Migrations/Mysql/Version20170110130253.php @@ -2,9 +2,10 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Platforms\MySQL57Platform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; class Version20170110130253 extends AbstractMigration { @@ -22,7 +23,7 @@ public function getDescription(): string */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); // Renaming of indexes is only possible with MySQL version 5.7+ if ($this->connection->getDatabasePlatform() instanceof MySQL57Platform) { @@ -69,7 +70,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); // Renaming of indexes is only possible with MySQL version 5.7+ if ($this->connection->getDatabasePlatform() instanceof MySQL57Platform) { diff --git a/Neos.Neos/Migrations/Mysql/Version20170115114801.php b/Neos.Neos/Migrations/Mysql/Version20170115114801.php index 5f543555ed5..26e9b6b22a8 100644 --- a/Neos.Neos/Migrations/Mysql/Version20170115114801.php +++ b/Neos.Neos/Migrations/Mysql/Version20170115114801.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Rename Typo3BackendProvider to Neos.Neos:Backend @@ -24,7 +25,7 @@ public function getDescription(): string */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql("UPDATE neos_flow_security_account SET authenticationprovidername = 'Neos.Neos:Backend' WHERE authenticationprovidername = 'Typo3BackendProvider'"); } @@ -35,7 +36,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql("UPDATE neos_flow_security_account SET authenticationprovidername = 'Typo3BackendProvider' WHERE authenticationprovidername = 'Neos.Neos:Backend'"); } diff --git a/Neos.Neos/Migrations/Mysql/Version20171206140453.php b/Neos.Neos/Migrations/Mysql/Version20171206140453.php index c183680b66f..f8f0b4c5621 100644 --- a/Neos.Neos/Migrations/Mysql/Version20171206140453.php +++ b/Neos.Neos/Migrations/Mysql/Version20171206140453.php @@ -2,9 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; -use Doctrine\DBAL\Platforms\MySQL57Platform; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; class Version20171206140453 extends AbstractMigration { @@ -22,7 +22,7 @@ public function getDescription(): string */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('CREATE INDEX documentnodeidentifier ON neos_neos_eventlog_domain_model_event (documentnodeidentifier)'); } @@ -33,7 +33,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('DROP INDEX documentnodeidentifier ON neos_neos_eventlog_domain_model_event'); } diff --git a/Neos.Neos/Migrations/Mysql/Version20210125134503.php b/Neos.Neos/Migrations/Mysql/Version20210125134503.php index 360b7b0d406..2445b934093 100644 --- a/Neos.Neos/Migrations/Mysql/Version20210125134503.php +++ b/Neos.Neos/Migrations/Mysql/Version20210125134503.php @@ -4,6 +4,8 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; +use Doctrine\DBAL\Exception; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; @@ -16,11 +18,11 @@ public function getDescription(): string /** * @param Schema $schema - * @throws \Doctrine\DBAL\Exception + * @throws Exception */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('ALTER TABLE neos_neos_eventlog_domain_model_event ADD dimensionshash VARCHAR(32) DEFAULT NULL'); $this->addSql('CREATE INDEX dimensionshash ON neos_neos_eventlog_domain_model_event (dimensionshash)'); @@ -28,11 +30,11 @@ public function up(Schema $schema): void /** * @param Schema $schema - * @throws \Doctrine\DBAL\Exception + * @throws Exception */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('DROP INDEX dimensionshash ON neos_neos_eventlog_domain_model_event'); $this->addSql('ALTER TABLE neos_neos_eventlog_domain_model_event DROP dimensionshash'); @@ -41,7 +43,7 @@ public function down(Schema $schema): void /** * @param Schema $schema * @throws \Doctrine\DBAL\Driver\Exception - * @throws \Doctrine\DBAL\Exception + * @throws Exception */ public function postUp(Schema $schema): void { diff --git a/Neos.Neos/Migrations/Mysql/Version20211220145601.php b/Neos.Neos/Migrations/Mysql/Version20211220145601.php index 8417bf0f7bf..15ee4a80c8e 100644 --- a/Neos.Neos/Migrations/Mysql/Version20211220145601.php +++ b/Neos.Neos/Migrations/Mysql/Version20211220145601.php @@ -2,9 +2,10 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\Exception\AbortMigration as AbortMigrationException; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; +use Doctrine\Migrations\Exception\AbortMigration as AbortMigrationException; /** * Add workspace/parent index to NodeEvent table @@ -26,7 +27,7 @@ public function getDescription(): string */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('CREATE INDEX workspacename_parentevent ON neos_neos_eventlog_domain_model_event (workspacename, parentevent)'); } @@ -38,7 +39,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $this->addSql('DROP INDEX workspacename_parentevent ON neos_neos_eventlog_domain_model_event'); } diff --git a/Neos.Neos/Migrations/Mysql/Version20231012072631.php b/Neos.Neos/Migrations/Mysql/Version20231012072631.php index 0bfc08bc314..3fbd9c90f70 100644 --- a/Neos.Neos/Migrations/Mysql/Version20231012072631.php +++ b/Neos.Neos/Migrations/Mysql/Version20231012072631.php @@ -4,6 +4,7 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; @@ -17,7 +18,7 @@ public function getDescription(): string public function up(Schema $schema): void { $this->abortIf( - !$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDb1027Platform, + !$this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform, "Migration can only be executed safely on '\Doctrine\DBAL\Platforms\MariaDb1027Platform'." ); @@ -27,7 +28,7 @@ public function up(Schema $schema): void public function down(Schema $schema): void { $this->abortIf( - !$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDb1027Platform, + !$this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform, "Migration can only be executed safely on '\Doctrine\DBAL\Platforms\MariaDb1027Platform'." ); diff --git a/Neos.Neos/Migrations/Postgresql/Version20120412194614.php b/Neos.Neos/Migrations/Postgresql/Version20120412194614.php index e1b74af170d..389dd077b87 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20120412194614.php +++ b/Neos.Neos/Migrations/Postgresql/Version20120412194614.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Create tables for PostgreSQL @@ -16,7 +17,7 @@ class Version20120412194614 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("CREATE TABLE typo3_typo3_domain_model_domain (flow3_persistence_identifier VARCHAR(40) NOT NULL, site VARCHAR(40) DEFAULT NULL, hostpattern VARCHAR(255) NOT NULL, PRIMARY KEY(flow3_persistence_identifier))"); $this->addSql("CREATE INDEX IDX_F227E8F6694309E4 ON typo3_typo3_domain_model_domain (site)"); @@ -36,7 +37,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_typo3_domain_model_user DROP CONSTRAINT FK_E3F98B1321E3D446"); $this->addSql("ALTER TABLE typo3_typo3_domain_model_domain DROP CONSTRAINT FK_F227E8F6694309E4"); diff --git a/Neos.Neos/Migrations/Postgresql/Version20120429225208.php b/Neos.Neos/Migrations/Postgresql/Version20120429225208.php index 0c021df722d..ef46a58daee 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20120429225208.php +++ b/Neos.Neos/Migrations/Postgresql/Version20120429225208.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Create unique indexes for identity properties @@ -16,7 +17,7 @@ class Version20120429225208 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("CREATE UNIQUE INDEX flow3_identity_typo3_typo3_domain_model_site ON typo3_typo3_domain_model_site (nodename)"); } @@ -27,7 +28,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("DROP INDEX flow3_identity_typo3_typo3_domain_model_site"); } diff --git a/Neos.Neos/Migrations/Postgresql/Version20121002121215.php b/Neos.Neos/Migrations/Postgresql/Version20121002121215.php index 212813c88eb..681a7521458 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20121002121215.php +++ b/Neos.Neos/Migrations/Postgresql/Version20121002121215.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; use Neos\Flow\Persistence\Doctrine\Service; /** @@ -17,7 +18,7 @@ class Version20121002121215 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); // collect foreign keys pointing to "our" tables $tableNames = array( @@ -51,7 +52,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); // collect foreign keys pointing to "our" tables $tableNames = array( diff --git a/Neos.Neos/Migrations/Postgresql/Version20121030103851.php b/Neos.Neos/Migrations/Postgresql/Version20121030103851.php index f3c531b2e18..d16b34329ef 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20121030103851.php +++ b/Neos.Neos/Migrations/Postgresql/Version20121030103851.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Rename from TYPO3 and/or Phoenix to Neos as needed @@ -16,7 +17,7 @@ class Version20121030103851 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_typo3_domain_model_site RENAME TO typo3_neos_domain_model_site"); $this->addSql("ALTER TABLE typo3_typo3_domain_model_domain RENAME TO typo3_neos_domain_model_domain"); @@ -38,7 +39,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_neos_domain_model_site RENAME TO typo3_typo3_domain_model_site"); $this->addSql("ALTER TABLE typo3_neos_domain_model_domain RENAME TO typo3_typo3_domain_model_domain"); diff --git a/Neos.Neos/Migrations/Postgresql/Version20121031190214.php b/Neos.Neos/Migrations/Postgresql/Version20121031190214.php index 1c914373798..4da3797e443 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20121031190214.php +++ b/Neos.Neos/Migrations/Postgresql/Version20121031190214.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Add state field to the "Domain" domain model schema @@ -16,7 +17,7 @@ class Version20121031190214 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_neos_domain_model_domain ADD active BOOLEAN NOT NULL"); } @@ -27,7 +28,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_neos_domain_model_domain DROP active"); } diff --git a/Neos.Neos/Migrations/Postgresql/Version20130213180302.php b/Neos.Neos/Migrations/Postgresql/Version20130213180302.php index f3a78b45e08..2173266ee59 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20130213180302.php +++ b/Neos.Neos/Migrations/Postgresql/Version20130213180302.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Create unique indexes for identity properties @@ -16,7 +17,7 @@ class Version20130213180302 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("CREATE UNIQUE INDEX flow_identity_typo3_neos_domain_model_domain ON typo3_neos_domain_model_domain (hostpattern)"); } @@ -27,7 +28,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("DROP INDEX flow_identity_typo3_neos_domain_model_domain"); } diff --git a/Neos.Neos/Migrations/Postgresql/Version20131112191120.php b/Neos.Neos/Migrations/Postgresql/Version20131112191120.php index c9c9b8ea795..cbb5b08e56c 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20131112191120.php +++ b/Neos.Neos/Migrations/Postgresql/Version20131112191120.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Remove the site content object proxy from all site nodes and change their node type to "TYPO3.Neos:Shortcut" @@ -16,7 +17,7 @@ class Version20131112191120 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_nodedata']); @@ -31,7 +32,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_nodedata', 'typo3_typo3cr_domain_model_contentobjectproxy']); diff --git a/Neos.Neos/Migrations/Postgresql/Version20141125133037.php b/Neos.Neos/Migrations/Postgresql/Version20141125133037.php index 0a58e7816ff..c83dfea03c5 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20141125133037.php +++ b/Neos.Neos/Migrations/Postgresql/Version20141125133037.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Create Event Log Table @@ -16,7 +17,7 @@ class Version20141125133037 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("CREATE SEQUENCE typo3_neos_eventlog_domain_model_event_uid_seq INCREMENT BY 1 MINVALUE 1 START 1"); $this->addSql("CREATE TABLE typo3_neos_eventlog_domain_model_event (persistence_object_identifier VARCHAR(40) NOT NULL, parentevent VARCHAR(40) DEFAULT NULL, timestamp TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, uid INT DEFAULT nextval('typo3_neos_eventlog_domain_model_event_uid_seq'), eventtype VARCHAR(255) NOT NULL, accountidentifier VARCHAR(255) DEFAULT NULL, data TEXT NOT NULL, dtype VARCHAR(255) NOT NULL, nodeidentifier VARCHAR(255) DEFAULT NULL, documentnodeidentifier VARCHAR(255) DEFAULT NULL, workspacename VARCHAR(255) DEFAULT NULL, dimension TEXT DEFAULT NULL, PRIMARY KEY(persistence_object_identifier))"); @@ -32,7 +33,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_neos_eventlog_domain_model_event DROP CONSTRAINT FK_30AB3A75B684C08"); $this->addSql("DROP TABLE typo3_neos_eventlog_domain_model_event"); diff --git a/Neos.Neos/Migrations/Postgresql/Version20150224171108.php b/Neos.Neos/Migrations/Postgresql/Version20150224171108.php index 84649df74a6..6d148e93616 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20150224171108.php +++ b/Neos.Neos/Migrations/Postgresql/Version20150224171108.php @@ -2,8 +2,10 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; +use Neos\Flow\Utility\Algorithms; /** * Adjust event log table to schema valid table structure @@ -16,7 +18,7 @@ class Version20150224171108 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_neos_eventlog_domain_model_event DROP CONSTRAINT FK_30AB3A75B684C08"); $this->addSql("ALTER TABLE typo3_neos_eventlog_domain_model_event DROP CONSTRAINT typo3_neos_eventlog_domain_model_event_pkey"); @@ -38,7 +40,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_neos_eventlog_domain_model_event DROP CONSTRAINT fk_30ab3a75b684c08"); $this->addSql("ALTER TABLE typo3_neos_eventlog_domain_model_event DROP CONSTRAINT typo3_neos_eventlog_domain_model_event_pkey"); @@ -50,7 +52,7 @@ public function down(Schema $schema): void } else { $result = $this->connection->executeQuery("SELECT uid FROM typo3_neos_eventlog_domain_model_event"); while ($uid = $result->fetchColumn()) { - $this->addSql("UPDATE typo3_neos_eventlog_domain_model_event SET persistence_object_identifier = '" . \Neos\Flow\Utility\Algorithms::generateUUID() . "' WHERE uid = " . $uid); + $this->addSql("UPDATE typo3_neos_eventlog_domain_model_event SET persistence_object_identifier = '" . Algorithms::generateUUID() . "' WHERE uid = " . $uid); } } $this->addSql("ALTER TABLE typo3_neos_eventlog_domain_model_event ALTER COLUMN persistence_object_identifier SET NOT NULL"); diff --git a/Neos.Neos/Migrations/Postgresql/Version20150309212115.php b/Neos.Neos/Migrations/Postgresql/Version20150309212115.php index be0dfe7b460..347a9b34953 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20150309212115.php +++ b/Neos.Neos/Migrations/Postgresql/Version20150309212115.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Adjust DB schema to a clean state (remove cruft that built up in the past) @@ -16,7 +17,7 @@ class Version20150309212115 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); // Doctrine fetches the next value from the sequence itself before persisting, so no nextval() needed $this->addSql("ALTER TABLE typo3_neos_eventlog_domain_model_event ALTER uid DROP DEFAULT"); @@ -32,7 +33,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("SELECT setval('typo3_neos_eventlog_domain_model_event_uid_seq', (SELECT MAX(uid) FROM typo3_neos_eventlog_domain_model_event))"); $this->addSql("ALTER TABLE typo3_neos_eventlog_domain_model_event ALTER uid SET DEFAULT nextval('typo3_neos_eventlog_domain_model_event_uid_seq')"); diff --git a/Neos.Neos/Migrations/Postgresql/Version20150507204453.php b/Neos.Neos/Migrations/Postgresql/Version20150507204453.php index 99be9284b3d..2d48d89f3fd 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20150507204453.php +++ b/Neos.Neos/Migrations/Postgresql/Version20150507204453.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Add asset collection to site @@ -16,7 +17,7 @@ class Version20150507204453 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_neos_domain_model_site ADD assetcollection VARCHAR(40) DEFAULT NULL"); $this->addSql("ALTER TABLE typo3_neos_domain_model_site ADD CONSTRAINT FK_1854B2075CEB2C15 FOREIGN KEY (assetcollection) REFERENCES typo3_media_domain_model_assetcollection (persistence_object_identifier) NOT DEFERRABLE INITIALLY IMMEDIATE"); @@ -29,7 +30,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("ALTER TABLE typo3_neos_domain_model_site DROP CONSTRAINT FK_1854B2075CEB2C15"); $this->addSql("DROP INDEX IDX_1854B2075CEB2C15"); diff --git a/Neos.Neos/Migrations/Postgresql/Version20150724091150.php b/Neos.Neos/Migrations/Postgresql/Version20150724091150.php index c609edd15a4..b175414d8d9 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20150724091150.php +++ b/Neos.Neos/Migrations/Postgresql/Version20150724091150.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Adds indices to the event log to improve performance @@ -16,7 +17,7 @@ class Version20150724091150 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("CREATE INDEX neos_eventlog_documentnodeidentifier ON typo3_neos_eventlog_domain_model_event (documentnodeidentifier)"); $this->addSql("CREATE INDEX neos_eventlog_eventtype ON typo3_neos_eventlog_domain_model_event (eventtype)"); @@ -28,7 +29,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("DROP INDEX neos_eventlog_documentnodeidentifier"); $this->addSql("DROP INDEX neos_eventlog_eventtype"); diff --git a/Neos.Neos/Migrations/Postgresql/Version20151117125552.php b/Neos.Neos/Migrations/Postgresql/Version20151117125552.php index 9221ff767c3..270e9d2a276 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20151117125552.php +++ b/Neos.Neos/Migrations/Postgresql/Version20151117125552.php @@ -2,8 +2,10 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; +use PDO; /** * Set the Workspace "owner" field for all personal workspaces @@ -16,24 +18,24 @@ class Version20151117125552 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_workspace']); if ($hasTables) { $workspacesQuery = $this->connection->executeQuery('SELECT name FROM typo3_typo3cr_domain_model_workspace t0 WHERE t0.name LIKE \'user-%\' AND t0.owner IS NULL'); - while ($workspaceRecord = $workspacesQuery->fetch(\PDO::FETCH_ASSOC)) { + while ($workspaceRecord = $workspacesQuery->fetch(PDO::FETCH_ASSOC)) { $username = substr($workspaceRecord['name'], 5); $accountQuery = $this->connection->executeQuery('SELECT persistence_object_identifier FROM typo3_flow_security_account t0 WHERE t0.accountidentifier = \'' . $username . '\' AND t0.authenticationprovidername = \'Typo3BackendProvider\''); - $accountRecord = $accountQuery->fetch(\PDO::FETCH_ASSOC); + $accountRecord = $accountQuery->fetch(PDO::FETCH_ASSOC); $partyQuery = $this->connection->executeQuery('SELECT party_abstractparty FROM typo3_party_domain_model_abstractparty_accounts_join t0 WHERE t0.flow_security_account = \'' . $accountRecord['persistence_object_identifier'] . '\''); - $partyRecord = $partyQuery->fetch(\PDO::FETCH_ASSOC); + $partyRecord = $partyQuery->fetch(PDO::FETCH_ASSOC); $this->addSql('UPDATE typo3_typo3cr_domain_model_workspace SET owner = \'' . $partyRecord['party_abstractparty'] . '\' WHERE name = \'user-' . $username . '\''); @@ -47,7 +49,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_workspace']); if ($hasTables) { diff --git a/Neos.Neos/Migrations/Postgresql/Version20151120170812.php b/Neos.Neos/Migrations/Postgresql/Version20151120170812.php index 0ffdbea52b2..e3ff2f2528f 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20151120170812.php +++ b/Neos.Neos/Migrations/Postgresql/Version20151120170812.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Change column type from json to jsonb on dimensionvalues and accessroles @@ -16,7 +17,7 @@ class Version20151120170812 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_nodedata']); @@ -34,7 +35,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_nodedata']); diff --git a/Neos.Neos/Migrations/Postgresql/Version20151126122252.php b/Neos.Neos/Migrations/Postgresql/Version20151126122252.php index 686cda839fe..eccbf37a07d 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20151126122252.php +++ b/Neos.Neos/Migrations/Postgresql/Version20151126122252.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Adjust column type and index names on Event schema to match code @@ -19,7 +20,7 @@ class Version20151126122252 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("TRUNCATE TABLE typo3_neos_eventlog_domain_model_event"); @@ -36,7 +37,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("TRUNCATE TABLE typo3_neos_eventlog_domain_model_event"); diff --git a/Neos.Neos/Migrations/Postgresql/Version20151223125946.php b/Neos.Neos/Migrations/Postgresql/Version20151223125946.php index aff271d8c4f..99321c107ec 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20151223125946.php +++ b/Neos.Neos/Migrations/Postgresql/Version20151223125946.php @@ -2,9 +2,11 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; use Neos\Neos\Utility\User as UserUtility; +use PDO; /** * Set the Workspace "owner" field for all personal workspaces with special characters in the username @@ -17,21 +19,21 @@ class Version20151223125946 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_workspace']); if ($hasTables) { $workspacesWithoutOwnerQuery = $this->connection->executeQuery('SELECT name FROM typo3_typo3cr_domain_model_workspace t0 WHERE t0.name LIKE \'user-%\' AND t0.owner IS NULL'); - $workspacesWithoutOwner = $workspacesWithoutOwnerQuery->fetchAll(\PDO::FETCH_ASSOC); + $workspacesWithoutOwner = $workspacesWithoutOwnerQuery->fetchAll(PDO::FETCH_ASSOC); if ($workspacesWithoutOwner === []) { return; } $neosAccountQuery = $this->connection->executeQuery('SELECT t0.party_abstractparty, t1.accountidentifier FROM typo3_party_domain_model_abstractparty_accounts_join t0 JOIN typo3_flow_security_account t1 ON t0.flow_security_account = t1.persistence_object_identifier WHERE t1.authenticationprovidername = \'Typo3BackendProvider\''); - while ($account = $neosAccountQuery->fetch(\PDO::FETCH_ASSOC)) { + while ($account = $neosAccountQuery->fetch(PDO::FETCH_ASSOC)) { $normalizedUsername = UserUtility::slugifyUsername($account['accountidentifier']); foreach ($workspacesWithoutOwner as $workspaceWithoutOwner) { @@ -51,7 +53,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_workspace']); if ($hasTables) { diff --git a/Neos.Neos/Migrations/Postgresql/Version20160104121413.php b/Neos.Neos/Migrations/Postgresql/Version20160104121413.php index 1b4eb699941..16f6585f454 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20160104121413.php +++ b/Neos.Neos/Migrations/Postgresql/Version20160104121413.php @@ -2,9 +2,11 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; use Neos\Neos\Utility\User as UserUtility; +use PDO; /** * Set the Workspace "owner" field for all personal workspaces with special characters in the username @@ -17,21 +19,21 @@ class Version20160104121413 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_workspace']); if ($hasTables) { $workspacesWithoutOwnerQuery = $this->connection->executeQuery("SELECT name FROM typo3_typo3cr_domain_model_workspace t0 WHERE t0.name LIKE 'user-%' AND t0.owner = ''"); - $workspacesWithoutOwner = $workspacesWithoutOwnerQuery->fetchAll(\PDO::FETCH_ASSOC); + $workspacesWithoutOwner = $workspacesWithoutOwnerQuery->fetchAll(PDO::FETCH_ASSOC); if ($workspacesWithoutOwner === []) { return; } $neosAccountQuery = $this->connection->executeQuery('SELECT t0.party_abstractparty, t1.accountidentifier FROM typo3_party_domain_model_abstractparty_accounts_join t0 JOIN typo3_flow_security_account t1 ON t0.flow_security_account = t1.persistence_object_identifier WHERE t1.authenticationprovidername = \'Typo3BackendProvider\''); - while ($account = $neosAccountQuery->fetch(\PDO::FETCH_ASSOC)) { + while ($account = $neosAccountQuery->fetch(PDO::FETCH_ASSOC)) { $normalizedUsername = UserUtility::slugifyUsername($account['accountidentifier']); foreach ($workspacesWithoutOwner as $workspaceWithoutOwner) { @@ -51,7 +53,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['typo3_typo3cr_domain_model_workspace']); if ($hasTables) { diff --git a/Neos.Neos/Migrations/Postgresql/Version20160212141533.php b/Neos.Neos/Migrations/Postgresql/Version20160212141533.php index ae8f6e812ea..2a1c3d412bf 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20160212141533.php +++ b/Neos.Neos/Migrations/Postgresql/Version20160212141533.php @@ -2,9 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration, - - Doctrine\DBAL\Schema\Schema; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; +use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Adjust some (old) index names to current Doctrine DBAL behavior (see https://jira.neos.io/browse/FLOW-427) @@ -17,7 +17,7 @@ class Version20160212141533 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); // typo3_neos_domain_model_domain $this->addSql("ALTER INDEX IF EXISTS idx_f227e8f6694309e4 RENAME TO IDX_8E49A537694309E4"); @@ -35,7 +35,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); // typo3_neos_domain_model_domain $this->addSql("ALTER INDEX IF EXISTS IDX_8E49A537694309E4 RENAME TO idx_f227e8f6694309e4"); diff --git a/Neos.Neos/Migrations/Postgresql/Version20160411101639.php b/Neos.Neos/Migrations/Postgresql/Version20160411101639.php index 237eb2c7e8f..c235d5c0149 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20160411101639.php +++ b/Neos.Neos/Migrations/Postgresql/Version20160411101639.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Adds scheme and port to domain model @@ -16,7 +17,7 @@ class Version20160411101639 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE typo3_neos_domain_model_domain ADD scheme VARCHAR(255) DEFAULT NULL'); $this->addSql('ALTER TABLE typo3_neos_domain_model_domain ADD port INT DEFAULT NULL'); @@ -28,7 +29,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE typo3_neos_domain_model_domain DROP scheme'); $this->addSql('ALTER TABLE typo3_neos_domain_model_domain DROP port'); diff --git a/Neos.Neos/Migrations/Postgresql/Version20160411101640.php b/Neos.Neos/Migrations/Postgresql/Version20160411101640.php index e561e22b8db..fab48e0c0cb 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20160411101640.php +++ b/Neos.Neos/Migrations/Postgresql/Version20160411101640.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Adds primary domain to site model @@ -16,7 +17,7 @@ class Version20160411101640 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE typo3_neos_domain_model_site ADD primarydomain VARCHAR(40) DEFAULT NULL'); $this->addSql('ALTER TABLE typo3_neos_domain_model_site ADD CONSTRAINT FK_1854B207B8872B4A FOREIGN KEY (primarydomain) REFERENCES typo3_neos_domain_model_domain (persistence_object_identifier) NOT DEFERRABLE INITIALLY IMMEDIATE'); @@ -29,7 +30,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE typo3_neos_domain_model_site DROP CONSTRAINT FK_1854B207B8872B4A'); $this->addSql('DROP INDEX IDX_1854B207B8872B4A'); diff --git a/Neos.Neos/Migrations/Postgresql/Version20160711103440.php b/Neos.Neos/Migrations/Postgresql/Version20160711103440.php index 691e7d6e896..a8a66a10b0b 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20160711103440.php +++ b/Neos.Neos/Migrations/Postgresql/Version20160711103440.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Rename hostpattern to hostname @@ -15,7 +16,7 @@ class Version20160711103440 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("DROP INDEX flow_identity_typo3_neos_domain_model_domain"); $this->addSql("ALTER TABLE typo3_neos_domain_model_domain RENAME COLUMN hostpattern TO hostname"); @@ -27,7 +28,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform)); $this->addSql("DROP INDEX flow_identity_typo3_neos_domain_model_domain"); $this->addSql("ALTER TABLE typo3_neos_domain_model_domain RENAME COLUMN hostname TO hostpattern"); diff --git a/Neos.Neos/Migrations/Postgresql/Version20161125093801.php b/Neos.Neos/Migrations/Postgresql/Version20161125093801.php index b0d741c954d..3da8f13de22 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20161125093801.php +++ b/Neos.Neos/Migrations/Postgresql/Version20161125093801.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Adjust table names to the renaming of TYPO3.Neos to Neos.Neos. @@ -16,7 +17,7 @@ class Version20161125093801 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE typo3_neos_domain_model_domain RENAME TO neos_neos_domain_model_domain'); $this->addSql('ALTER TABLE typo3_neos_domain_model_site RENAME TO neos_neos_domain_model_site'); @@ -31,7 +32,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE neos_neos_domain_model_domain RENAME TO typo3_neos_domain_model_domain'); $this->addSql('ALTER TABLE neos_neos_domain_model_site RENAME TO typo3_neos_domain_model_site'); diff --git a/Neos.Neos/Migrations/Postgresql/Version20161125125249.php b/Neos.Neos/Migrations/Postgresql/Version20161125125249.php index b1b6ad54278..fafa5441712 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20161125125249.php +++ b/Neos.Neos/Migrations/Postgresql/Version20161125125249.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Rename node names in neos_contentrepository_domain_model_nodedata @@ -16,7 +17,7 @@ class Version20161125125249 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['neos_contentrepository_domain_model_nodedata']); @@ -37,7 +38,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['neos_contentrepository_domain_model_nodedata']); diff --git a/Neos.Neos/Migrations/Postgresql/Version20161125171831.php b/Neos.Neos/Migrations/Postgresql/Version20161125171831.php index cc58e99d295..a3f0ef9ac5b 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20161125171831.php +++ b/Neos.Neos/Migrations/Postgresql/Version20161125171831.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Rename node names in neos_contentrepository_domain_model_nodedata @@ -16,7 +17,7 @@ class Version20161125171831 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql("UPDATE neos_neos_eventlog_domain_model_event SET dtype = REPLACE(dtype, 'typo3_neos_', 'neos_neos_')"); } @@ -27,7 +28,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql("UPDATE neos_neos_eventlog_domain_model_event SET dtype = REPLACE(dtype, 'neos_neos_', 'typo3_neos_')"); } diff --git a/Neos.Neos/Migrations/Postgresql/Version20161127010617.php b/Neos.Neos/Migrations/Postgresql/Version20161127010617.php index a9879b02f61..7acb55bdf62 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20161127010617.php +++ b/Neos.Neos/Migrations/Postgresql/Version20161127010617.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Adjust table names to the renaming of TYPO3.Neos to Neos.Neos. @@ -16,7 +17,7 @@ class Version20161127010617 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE typo3_neos_eventlog_domain_model_event_uid_seq RENAME TO neos_neos_eventlog_domain_model_event_uid_seq'); } @@ -27,7 +28,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE neos_neos_eventlog_domain_model_event_uid_seq RENAME TO typo3_neos_eventlog_domain_model_event_uid_seq'); } diff --git a/Neos.Neos/Migrations/Postgresql/Version20170110133114.php b/Neos.Neos/Migrations/Postgresql/Version20170110133114.php index dfce4811ece..b1024468bb6 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20170110133114.php +++ b/Neos.Neos/Migrations/Postgresql/Version20170110133114.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; class Version20170110133114 extends AbstractMigration { @@ -21,7 +22,7 @@ public function getDescription(): string */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER INDEX idx_8e49a537694309e4 RENAME TO IDX_51265BE9694309E4'); $this->addSql('ALTER INDEX flow_identity_typo3_neos_domain_model_domain RENAME TO flow_identity_neos_neos_domain_model_domain'); @@ -38,7 +39,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER INDEX uniq_ed60f5e3e931a6f5 RENAME TO uniq_fc846daae931a6f5'); $this->addSql('ALTER INDEX idx_51265be9694309e4 RENAME TO idx_8e49a537694309e4'); diff --git a/Neos.Neos/Migrations/Postgresql/Version20170115115240.php b/Neos.Neos/Migrations/Postgresql/Version20170115115240.php index fdbc14096a7..74df58c1e3f 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20170115115240.php +++ b/Neos.Neos/Migrations/Postgresql/Version20170115115240.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Rename Typo3BackendProvider to Neos.Neos:Backend @@ -24,7 +25,7 @@ public function getDescription(): string */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql("UPDATE neos_flow_security_account SET authenticationprovidername = 'Neos.Neos:Backend' WHERE authenticationprovidername = 'Typo3BackendProvider'"); } @@ -35,7 +36,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql("UPDATE neos_flow_security_account SET authenticationprovidername = 'Typo3BackendProvider' WHERE authenticationprovidername = 'Neos.Neos:Backend'"); } diff --git a/Neos.Neos/Migrations/Postgresql/Version20170629102140.php b/Neos.Neos/Migrations/Postgresql/Version20170629102140.php index 90d817db52a..a886840fb60 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20170629102140.php +++ b/Neos.Neos/Migrations/Postgresql/Version20170629102140.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Set default for event uid column @@ -24,7 +25,7 @@ public function getDescription(): string */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql("SELECT setval('neos_neos_eventlog_domain_model_event_uid_seq', (SELECT MAX(uid) FROM neos_neos_eventlog_domain_model_event))"); $this->addSql("ALTER TABLE neos_neos_eventlog_domain_model_event ALTER uid SET DEFAULT nextval('neos_neos_eventlog_domain_model_event_uid_seq')"); diff --git a/Neos.Neos/Migrations/Postgresql/Version20211220145602.php b/Neos.Neos/Migrations/Postgresql/Version20211220145602.php index a0d9cd76624..7ecf1f47b66 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20211220145602.php +++ b/Neos.Neos/Migrations/Postgresql/Version20211220145602.php @@ -2,9 +2,10 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\Exception\AbortMigration as AbortMigrationException; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; +use Doctrine\Migrations\Exception\AbortMigration as AbortMigrationException; /** * Add workspace/parent index to NodeEvent table @@ -26,7 +27,7 @@ public function getDescription(): string */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('CREATE INDEX workspacename_parentevent ON neos_neos_eventlog_domain_model_event (workspacename, parentevent)'); } @@ -38,7 +39,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('DROP INDEX workspacename_parentevent'); } diff --git a/Neos.Neos/Migrations/Postgresql/Version20230727164600.php b/Neos.Neos/Migrations/Postgresql/Version20230727164600.php index e584f6e34a3..32628da794c 100644 --- a/Neos.Neos/Migrations/Postgresql/Version20230727164600.php +++ b/Neos.Neos/Migrations/Postgresql/Version20230727164600.php @@ -3,6 +3,8 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; +use Doctrine\DBAL\Exception; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; use Neos\ContentRepository\Utility; @@ -16,11 +18,11 @@ public function getDescription() : string /** * @param Schema $schema - * @throws \Doctrine\DBAL\Exception + * @throws Exception */ public function up(Schema $schema) : void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('ALTER TABLE neos_neos_eventlog_domain_model_event ADD dimensionshash VARCHAR(32) DEFAULT NULL'); $this->addSql('CREATE INDEX dimensionshash ON neos_neos_eventlog_domain_model_event (dimensionshash)'); @@ -28,11 +30,11 @@ public function up(Schema $schema) : void /** * @param Schema $schema - * @throws \Doctrine\DBAL\Exception + * @throws Exception */ public function down(Schema $schema) : void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $this->addSql('DROP INDEX dimensionshash'); $this->addSql('ALTER TABLE neos_neos_eventlog_domain_model_event DROP dimensionshash'); @@ -41,7 +43,7 @@ public function down(Schema $schema) : void /** * @param Schema $schema * @throws \Doctrine\DBAL\Driver\Exception - * @throws \Doctrine\DBAL\Exception + * @throws Exception */ public function postUp(Schema $schema): void { diff --git a/Neos.NodeTypes/Migrations/Mysql/Version20161125123504.php b/Neos.NodeTypes/Migrations/Mysql/Version20161125123504.php index ec091880200..6aa613e31c5 100644 --- a/Neos.NodeTypes/Migrations/Mysql/Version20161125123504.php +++ b/Neos.NodeTypes/Migrations/Mysql/Version20161125123504.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Rename node names in neos_contentrepository_domain_model_nodedata @@ -16,7 +17,7 @@ class Version20161125123504 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['neos_contentrepository_domain_model_nodedata']); @@ -31,7 +32,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform), 'Migration can only be executed safely on "mysql".'); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['neos_contentrepository_domain_model_nodedata']); diff --git a/Neos.NodeTypes/Migrations/Postgresql/Version20161125125004.php b/Neos.NodeTypes/Migrations/Postgresql/Version20161125125004.php index 84fd02bdc57..18748c7e9aa 100644 --- a/Neos.NodeTypes/Migrations/Postgresql/Version20161125125004.php +++ b/Neos.NodeTypes/Migrations/Postgresql/Version20161125125004.php @@ -2,8 +2,9 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\Migrations\AbstractMigration; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; /** * Rename node names in neos_contentrepository_domain_model_nodedata @@ -16,7 +17,7 @@ class Version20161125125004 extends AbstractMigration */ public function up(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['neos_contentrepository_domain_model_nodedata']); @@ -31,7 +32,7 @@ public function up(Schema $schema): void */ public function down(Schema $schema): void { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); + $this->abortIf(!($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform), 'Migration can only be executed safely on "postgresql".'); $schemaManager = $this->connection->createSchemaManager(); $hasTables = $schemaManager->tablesExist(['neos_contentrepository_domain_model_nodedata']); From 9d5da8f2913f055a0667cb7ac592f81d10e4e346 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Mu=CC=88ller?= Date: Wed, 10 Jul 2024 09:29:10 +0200 Subject: [PATCH 7/8] Fix DBAL deprecations --- .../DoctrineDbalContentGraphSchemaBuilder.php | 8 ++-- .../Projection/Feature/SubtreeTagging.php | 8 ++-- .../src/Domain/Repository/ContentGraph.php | 18 +++----- .../src/Domain/Repository/ContentSubgraph.php | 4 +- .../Repository/ProjectionContentGraph.php | 9 ++-- .../src/NodeQueryBuilder.php | 5 ++- .../Infrastructure/DbalSchemaFactory.php | 10 ++--- .../Workspace/WorkspaceProjection.php | 10 ++--- .../Command/MediaCommandController.php | 16 ++++---- .../Domain/Repository/AssetRepository.php | 32 ++------------- .../Domain/Repository/ThumbnailRepository.php | 41 ++++--------------- .../DocumentUriPathSchemaBuilder.php | 8 ++-- .../ChangeProjection.php | 2 +- 13 files changed, 58 insertions(+), 113 deletions(-) diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphSchemaBuilder.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphSchemaBuilder.php index 155f842414f..1bce0351273 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphSchemaBuilder.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphSchemaBuilder.php @@ -45,8 +45,8 @@ private function createNodeTable(): Table DbalSchemaFactory::columnForNodeAggregateId('nodeaggregateid')->setNotnull(false), DbalSchemaFactory::columnForDimensionSpacePointHash('origindimensionspacepointhash')->setNotnull(false), DbalSchemaFactory::columnForNodeTypeName('nodetypename'), - (new Column('name', self::type(Types::STRING)))->setLength(255)->setNotnull(false)->setCustomSchemaOption('charset', 'ascii')->setCustomSchemaOption('collation', 'ascii_general_ci'), - (new Column('properties', self::type(Types::TEXT)))->setNotnull(true)->setCustomSchemaOption('collation', self::DEFAULT_TEXT_COLLATION), + (new Column('name', self::type(Types::STRING)))->setLength(255)->setNotnull(false)->setPlatformOption('charset', 'ascii')->setPlatformOption('collation', 'ascii_general_ci'), + (new Column('properties', self::type(Types::TEXT)))->setNotnull(true)->setPlatformOption('collation', self::DEFAULT_TEXT_COLLATION), (new Column('classification', self::type(Types::BINARY)))->setLength(20)->setNotnull(true), (new Column('created', self::type(Types::DATETIME_IMMUTABLE)))->setDefault('CURRENT_TIMESTAMP')->setNotnull(true), (new Column('originalcreated', self::type(Types::DATETIME_IMMUTABLE)))->setDefault('CURRENT_TIMESTAMP')->setNotnull(true), @@ -93,10 +93,10 @@ private function createDimensionSpacePointsTable(): Table private function createReferenceRelationTable(): Table { $table = self::createTable($this->contentGraphTableNames->referenceRelation(), [ - (new Column('name', self::type(Types::STRING)))->setLength(255)->setNotnull(true)->setCustomSchemaOption('charset', 'ascii')->setCustomSchemaOption('collation', 'ascii_general_ci'), + (new Column('name', self::type(Types::STRING)))->setLength(255)->setNotnull(true)->setPlatformOption('charset', 'ascii')->setPlatformOption('collation', 'ascii_general_ci'), (new Column('position', self::type(Types::INTEGER)))->setNotnull(true), DbalSchemaFactory::columnForNodeAnchorPoint('nodeanchorpoint'), - (new Column('properties', self::type(Types::TEXT)))->setNotnull(false)->setCustomSchemaOption('collation', self::DEFAULT_TEXT_COLLATION), + (new Column('properties', self::type(Types::TEXT)))->setNotnull(false)->setPlatformOption('collation', self::DEFAULT_TEXT_COLLATION), DbalSchemaFactory::columnForNodeAggregateId('destinationnodeaggregateid')->setNotnull(true) ]); diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/SubtreeTagging.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/SubtreeTagging.php index ea7af0bb248..251b4d160d2 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/SubtreeTagging.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/SubtreeTagging.php @@ -4,7 +4,7 @@ namespace Neos\ContentGraph\DoctrineDbalAdapter\Domain\Projection\Feature; -use Doctrine\DBAL\Connection; +use Doctrine\DBAL\ArrayParameterType; use Doctrine\DBAL\Exception as DBALException; use Neos\ContentGraph\DoctrineDbalAdapter\Domain\Projection\NodeRelationAnchorPoint; use Neos\ContentGraph\DoctrineDbalAdapter\Domain\Repository\NodeFactory; @@ -58,7 +58,7 @@ private function addSubtreeTag(ContentStreamId $contentStreamId, NodeAggregateId 'dimensionSpacePointHashes' => $affectedDimensionSpacePoints->getPointHashes(), 'tagPath' => '$.' . $tag->value, ], [ - 'dimensionSpacePointHashes' => Connection::PARAM_STR_ARRAY, + 'dimensionSpacePointHashes' => ArrayParameterType::STRING, ]); } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to add subtree tag %s for content stream %s, node aggregate id %s and dimension space points %s: %s', $tag->value, $contentStreamId->value, $nodeAggregateId->value, $affectedDimensionSpacePoints->toJson(), $e->getMessage()), 1716479749, $e); @@ -80,7 +80,7 @@ private function addSubtreeTag(ContentStreamId $contentStreamId, NodeAggregateId 'dimensionSpacePointHashes' => $affectedDimensionSpacePoints->getPointHashes(), 'tagPath' => '$.' . $tag->value, ], [ - 'dimensionSpacePointHashes' => Connection::PARAM_STR_ARRAY, + 'dimensionSpacePointHashes' => ArrayParameterType::STRING, ]); } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to add subtree tag %s for content stream %s, node aggregate id %s and dimension space points %s: %s', $tag->value, $contentStreamId->value, $nodeAggregateId->value, $affectedDimensionSpacePoints->toJson(), $e->getMessage()), 1716479840, $e); @@ -135,7 +135,7 @@ private function removeSubtreeTag(ContentStreamId $contentStreamId, NodeAggregat 'dimensionSpacePointHashes' => $affectedDimensionSpacePoints->getPointHashes(), 'tagPath' => '$.' . $tag->value, ], [ - 'dimensionSpacePointHashes' => Connection::PARAM_STR_ARRAY, + 'dimensionSpacePointHashes' => ArrayParameterType::STRING, ]); } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to remove subtree tag %s for content stream %s, node aggregate id %s and dimension space points %s: %s', $tag->value, $contentStreamId->value, $nodeAggregateId->value, $affectedDimensionSpacePoints->toJson(), $e->getMessage()), 1716482293, $e); diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php index cc61e1c78d8..dd9afe2dc83 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php @@ -14,6 +14,7 @@ namespace Neos\ContentGraph\DoctrineDbalAdapter\Domain\Repository; +use Doctrine\DBAL\ArrayParameterType; use Doctrine\DBAL\Connection; use Doctrine\DBAL\Driver\Exception as DriverException; use Doctrine\DBAL\Exception as DBALException; @@ -292,7 +293,7 @@ public function getDimensionSpacePointsOccupiedByChildNodeName(NodeName $nodeNam 'dimensionSpacePointHashes' => $dimensionSpacePointsToCheck->getPointHashes(), 'nodeName' => $nodeName->value ], [ - 'dimensionSpacePointHashes' => Connection::PARAM_STR_ARRAY, + 'dimensionSpacePointHashes' => ArrayParameterType::STRING, ]); $dimensionSpacePoints = []; foreach ($this->fetchRows($queryBuilder) as $hierarchyRelationData) { @@ -308,12 +309,9 @@ public function countNodes(): int ->select('COUNT(*)') ->from($this->nodeQueryBuilder->tableNames->node()); try { - $result = $queryBuilder->execute(); - if (!$result instanceof Result) { - throw new \RuntimeException(sprintf('Failed to count nodes. Expected result to be of type %s, got: %s', Result::class, get_debug_type($result)), 1701444550); - } + $result = $queryBuilder->executeQuery(); return (int)$result->fetchOne(); - } catch (DriverException | DBALException $e) { + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to count rows in database: %s', $e->getMessage()), 1701444590, $e); } } @@ -361,12 +359,8 @@ private function mapQueryBuilderToNodeAggregates(QueryBuilder $queryBuilder): No private function fetchRows(QueryBuilder $queryBuilder): array { try { - $result = $queryBuilder->execute(); - if (!$result instanceof Result) { - throw new \RuntimeException(sprintf('Failed to execute query. Expected result to be of type %s, got: %s', Result::class, get_debug_type($result)), 1701443535); - } - return $result->fetchAllAssociative(); - } catch (DriverException | DBALException $e) { + return $queryBuilder->executeQuery()->fetchAllAssociative(); + } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to fetch rows from database: %s', $e->getMessage()), 1701444358, $e); } } diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php index 982b43cd6ed..fb67effe7f6 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php @@ -704,7 +704,7 @@ private function fetchNodes(QueryBuilder $queryBuilder): Nodes private function fetchCount(QueryBuilder $queryBuilder): int { try { - return (int)$this->executeQuery($queryBuilder->select('COUNT(*)')->resetQueryPart('orderBy')->setFirstResult(0)->setMaxResults(1))->fetchOne(); + return (int)$this->executeQuery($queryBuilder->select('COUNT(*)')->resetOrderBy()->setFirstResult(0)->setMaxResults(1))->fetchOne(); } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to fetch count: %s', $e->getMessage()), 1679048349, $e); } @@ -750,7 +750,7 @@ private function fetchCteCountResult(QueryBuilder $queryBuilderInitial, QueryBui UNION {$queryBuilderRecursive->getSQL()} ) - {$queryBuilderCte->select('COUNT(*)')->resetQueryPart('orderBy')->setFirstResult(0)->setMaxResults(1)} + {$queryBuilderCte->select('COUNT(*)')->resetOrderBy()->setFirstResult(0)->setMaxResults(1)} SQL; $parameters = array_merge($queryBuilderInitial->getParameters(), $queryBuilderRecursive->getParameters(), $queryBuilderCte->getParameters()); $parameterTypes = array_merge($queryBuilderInitial->getParameterTypes(), $queryBuilderRecursive->getParameterTypes(), $queryBuilderCte->getParameterTypes()); diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ProjectionContentGraph.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ProjectionContentGraph.php index 05f09b9a435..b8ff909b5cc 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ProjectionContentGraph.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ProjectionContentGraph.php @@ -14,6 +14,7 @@ namespace Neos\ContentGraph\DoctrineDbalAdapter\Domain\Repository; +use Doctrine\DBAL\ArrayParameterType; use Doctrine\DBAL\Connection; use Doctrine\DBAL\Exception as DBALException; use Neos\ContentGraph\DoctrineDbalAdapter\ContentGraphTableNames; @@ -411,7 +412,7 @@ public function findIngoingHierarchyRelationsForNode( if ($restrictToSet) { $ingoingHierarchyRelationsStatement .= ' AND h.dimensionspacepointhash IN (:dimensionSpacePointHashes)'; $parameters['dimensionSpacePointHashes'] = $restrictToSet->getPointHashes(); - $types['dimensionSpacePointHashes'] = Connection::PARAM_STR_ARRAY; + $types['dimensionSpacePointHashes'] = ArrayParameterType::STRING; } try { $rows = $this->dbal->fetchAllAssociative($ingoingHierarchyRelationsStatement, $parameters, $types); @@ -451,7 +452,7 @@ public function findOutgoingHierarchyRelationsForNode( if ($restrictToSet) { $outgoingHierarchyRelationsStatement .= ' AND h.dimensionspacepointhash IN (:dimensionSpacePointHashes)'; $parameters['dimensionSpacePointHashes'] = $restrictToSet->getPointHashes(); - $types['dimensionSpacePointHashes'] = Connection::PARAM_STR_ARRAY; + $types['dimensionSpacePointHashes'] = ArrayParameterType::STRING; } try { $rows = $this->dbal->fetchAllAssociative($outgoingHierarchyRelationsStatement, $parameters, $types); @@ -490,7 +491,7 @@ public function findOutgoingHierarchyRelationsForNodeAggregate( 'contentStreamId' => $contentStreamId->value, 'dimensionSpacePointHashes' => $dimensionSpacePointSet->getPointHashes() ], [ - 'dimensionSpacePointHashes' => Connection::PARAM_STR_ARRAY + 'dimensionSpacePointHashes' => ArrayParameterType::STRING ]); } catch (DBALException $e) { throw new \RuntimeException(sprintf('Failed to load outgoing hierarchy relations for content stream %s, node aggregate id %s and dimension space points %s from database: %s', $contentStreamId->value, $nodeAggregateId->value, $dimensionSpacePointSet->toJson(), $e->getMessage()), 1716476690, $e); @@ -524,7 +525,7 @@ public function findIngoingHierarchyRelationsForNodeAggregate( if ($dimensionSpacePointSet !== null) { $ingoingHierarchyRelationsStatement .= ' AND h.dimensionspacepointhash IN (:dimensionSpacePointHashes)'; $parameters['dimensionSpacePointHashes'] = $dimensionSpacePointSet->getPointHashes(); - $types['dimensionSpacePointHashes'] = Connection::PARAM_STR_ARRAY; + $types['dimensionSpacePointHashes'] = ArrayParameterType::STRING; } try { $rows = $this->dbal->fetchAllAssociative($ingoingHierarchyRelationsStatement, $parameters, $types); diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/NodeQueryBuilder.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/NodeQueryBuilder.php index a94f5fad88b..407d75ff554 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/NodeQueryBuilder.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/NodeQueryBuilder.php @@ -2,6 +2,7 @@ namespace Neos\ContentGraph\DoctrineDbalAdapter; +use Doctrine\DBAL\ArrayParameterType; use Doctrine\DBAL\Connection; use Doctrine\DBAL\ParameterType; use Doctrine\DBAL\Query\QueryBuilder; @@ -155,12 +156,12 @@ public function addNodeTypeCriteria(QueryBuilder $queryBuilder, ExpandedNodeType $allowanceQueryPart = ''; if (!$constraintsWithSubNodeTypes->explicitlyAllowedNodeTypeNames->isEmpty()) { $allowanceQueryPart = $queryBuilder->expr()->in($nodeTablePrefix . 'nodetypename', ':explicitlyAllowedNodeTypeNames'); - $queryBuilder->setParameter('explicitlyAllowedNodeTypeNames', $constraintsWithSubNodeTypes->explicitlyAllowedNodeTypeNames->toStringArray(), Connection::PARAM_STR_ARRAY); + $queryBuilder->setParameter('explicitlyAllowedNodeTypeNames', $constraintsWithSubNodeTypes->explicitlyAllowedNodeTypeNames->toStringArray(), ArrayParameterType::STRING); } $denyQueryPart = ''; if (!$constraintsWithSubNodeTypes->explicitlyDisallowedNodeTypeNames->isEmpty()) { $denyQueryPart = $queryBuilder->expr()->notIn($nodeTablePrefix . 'nodetypename', ':explicitlyDisallowedNodeTypeNames'); - $queryBuilder->setParameter('explicitlyDisallowedNodeTypeNames', $constraintsWithSubNodeTypes->explicitlyDisallowedNodeTypeNames->toStringArray(), Connection::PARAM_STR_ARRAY); + $queryBuilder->setParameter('explicitlyDisallowedNodeTypeNames', $constraintsWithSubNodeTypes->explicitlyDisallowedNodeTypeNames->toStringArray(), ArrayParameterType::STRING); } if ($allowanceQueryPart && $denyQueryPart) { if ($constraintsWithSubNodeTypes->isWildCardAllowed) { diff --git a/Neos.ContentRepository.Core/Classes/Infrastructure/DbalSchemaFactory.php b/Neos.ContentRepository.Core/Classes/Infrastructure/DbalSchemaFactory.php index b3c375b6873..dcaf89fca82 100644 --- a/Neos.ContentRepository.Core/Classes/Infrastructure/DbalSchemaFactory.php +++ b/Neos.ContentRepository.Core/Classes/Infrastructure/DbalSchemaFactory.php @@ -40,8 +40,8 @@ public static function columnForNodeAggregateId(string $columnName): Column { return (new Column($columnName, Type::getType(Types::STRING))) ->setLength(64) - ->setCustomSchemaOption('charset', 'ascii') - ->setCustomSchemaOption('collation', 'ascii_general_ci'); + ->setPlatformOption('charset', 'ascii') + ->setPlatformOption('collation', 'ascii_general_ci'); } /** @@ -86,7 +86,7 @@ public static function columnForDimensionSpacePoint(string $columnName): Column { return (new Column($columnName, Type::getType(Types::TEXT))) ->setDefault('{}') - ->setCustomSchemaOption('collation', 'utf8mb4_unicode_520_ci'); + ->setPlatformOption('collation', 'utf8mb4_unicode_520_ci'); } /** @@ -114,8 +114,8 @@ public static function columnForNodeTypeName(string $columnName): Column return (new Column($columnName, Type::getType(Types::STRING))) ->setLength(255) ->setNotnull(true) - ->setCustomSchemaOption('charset', 'ascii') - ->setCustomSchemaOption('collation', 'ascii_general_ci'); + ->setPlatformOption('charset', 'ascii') + ->setPlatformOption('collation', 'ascii_general_ci'); } /** diff --git a/Neos.ContentRepository.Core/Classes/Projection/Workspace/WorkspaceProjection.php b/Neos.ContentRepository.Core/Classes/Projection/Workspace/WorkspaceProjection.php index db872319ac4..72409d38bfe 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/Workspace/WorkspaceProjection.php +++ b/Neos.ContentRepository.Core/Classes/Projection/Workspace/WorkspaceProjection.php @@ -113,11 +113,11 @@ private function determineRequiredSqlStatements(): array { $schemaManager = $this->dbal->createSchemaManager(); $workspaceTable = new Table($this->tableName, [ - (new Column('workspacename', Type::getType(Types::STRING)))->setLength(255)->setNotnull(true)->setCustomSchemaOption('collation', self::DEFAULT_TEXT_COLLATION), - (new Column('baseworkspacename', Type::getType(Types::STRING)))->setLength(255)->setNotnull(false)->setCustomSchemaOption('collation', self::DEFAULT_TEXT_COLLATION), - (new Column('workspacetitle', Type::getType(Types::STRING)))->setLength(255)->setNotnull(true)->setCustomSchemaOption('collation', self::DEFAULT_TEXT_COLLATION), - (new Column('workspacedescription', Type::getType(Types::STRING)))->setLength(255)->setNotnull(true)->setCustomSchemaOption('collation', self::DEFAULT_TEXT_COLLATION), - (new Column('workspaceowner', Type::getType(Types::STRING)))->setLength(255)->setNotnull(false)->setCustomSchemaOption('collation', self::DEFAULT_TEXT_COLLATION), + (new Column('workspacename', Type::getType(Types::STRING)))->setLength(255)->setNotnull(true)->setPlatformOption('collation', self::DEFAULT_TEXT_COLLATION), + (new Column('baseworkspacename', Type::getType(Types::STRING)))->setLength(255)->setNotnull(false)->setPlatformOption('collation', self::DEFAULT_TEXT_COLLATION), + (new Column('workspacetitle', Type::getType(Types::STRING)))->setLength(255)->setNotnull(true)->setPlatformOption('collation', self::DEFAULT_TEXT_COLLATION), + (new Column('workspacedescription', Type::getType(Types::STRING)))->setLength(255)->setNotnull(true)->setPlatformOption('collation', self::DEFAULT_TEXT_COLLATION), + (new Column('workspaceowner', Type::getType(Types::STRING)))->setLength(255)->setNotnull(false)->setPlatformOption('collation', self::DEFAULT_TEXT_COLLATION), DbalSchemaFactory::columnForContentStreamId('currentcontentstreamid')->setNotNull(true), (new Column('status', Type::getType(Types::BINARY)))->setLength(20)->setNotnull(false) ]); diff --git a/Neos.Media/Classes/Command/MediaCommandController.php b/Neos.Media/Classes/Command/MediaCommandController.php index 782dde2c0d3..6eca3d1b9a3 100644 --- a/Neos.Media/Classes/Command/MediaCommandController.php +++ b/Neos.Media/Classes/Command/MediaCommandController.php @@ -231,7 +231,7 @@ public function removeUnusedCommand(string $assetSource = '', bool $quiet = fals !$quiet && $this->output->progressStart($assetCount); /** @var Asset $asset */ - foreach ($this->assetRepository->iterate($iterator) as $asset) { + foreach ($iterator as $asset) { !$quiet && $this->output->progressAdvance(1); if ($limit !== null && $unusedAssetCount === $limit) { @@ -326,7 +326,7 @@ public function createThumbnailsCommand(string $preset = null, bool $async = nul $iterator = $this->assetRepository->findAllIterator(); $imageCount = $this->assetRepository->countAll(); !$quiet && $this->output->progressStart($imageCount * count($presetThumbnailConfigurations)); - foreach ($this->assetRepository->iterate($iterator) as $image) { + foreach ($iterator as $image) { foreach ($presetThumbnailConfigurations as $presetThumbnailConfiguration) { $this->thumbnailService->getThumbnail($image, $presetThumbnailConfiguration); $this->persistenceManager->persistAll(); @@ -362,11 +362,10 @@ public function clearThumbnailsCommand(string $preset = null, bool $quiet = fals } !$quiet && $this->output->progressStart($thumbnailCount); - foreach ($this->thumbnailRepository->iterate($iterator, function ($iteration) { - $this->persistAll($iteration); - }) as $thumbnail) { + foreach ($iterator as $iteration => $thumbnail) { $this->thumbnailRepository->remove($thumbnail); - !$quiet && $this->output->progressAdvance(1); + $this->persistAll($iteration); + !$quiet && $this->output->progressAdvance(1); } !$quiet && $this->output->progressFinish(); !$quiet && $this->output->outputLine(); @@ -387,14 +386,13 @@ public function renderThumbnailsCommand(int $limit = null, bool $quiet = false) $thumbnailCount = $this->thumbnailRepository->countUngenerated(); $iterator = $this->thumbnailRepository->findUngeneratedIterator(); !$quiet && $this->output->progressStart($limit !== null && $thumbnailCount > $limit ? $limit : $thumbnailCount); - $iteration = 0; - foreach ($this->thumbnailRepository->iterate($iterator) as $thumbnail) { + foreach ($iterator as $iteration => $thumbnail) { if ($thumbnail->getResource() === null) { $this->thumbnailService->refreshThumbnail($thumbnail); $this->persistenceManager->persistAll(); } !$quiet && $this->output->progressAdvance(1); - if (++$iteration === $limit) { + if ($iteration === $limit) { break; } } diff --git a/Neos.Media/Classes/Domain/Repository/AssetRepository.php b/Neos.Media/Classes/Domain/Repository/AssetRepository.php index e65cc1fe9bd..e5ce0d225d7 100644 --- a/Neos.Media/Classes/Domain/Repository/AssetRepository.php +++ b/Neos.Media/Classes/Domain/Repository/AssetRepository.php @@ -13,7 +13,6 @@ * source code. */ -use Doctrine\ORM\Internal\Hydration\IterableResult; use Doctrine\ORM\NonUniqueResultException; use Doctrine\ORM\Query\ResultSetMapping; use Neos\Flow\Annotations as Flow; @@ -329,40 +328,17 @@ public function findOneByResourceSha1($sha1): ?AssetInterface } /** - * Iterate over an IterableResult and return a Generator + * Find all objects and return an iterable * - * This method is useful for batch processing huge result set as it clears the object - * manager and detaches the current object on each iteration. - * - * @param IterableResult $iterator - * @param callable $callback - * @return \Generator - */ - public function iterate(IterableResult $iterator, callable $callback = null): ?\Generator - { - $iteration = 0; - foreach ($iterator as $object) { - $object = current($object); - yield $object; - if ($callback !== null) { - $callback($iteration, $object); - } - $iteration++; - } - } - - /** - * Find all objects and return an IterableResult - * - * @return IterableResult + * @return iterable */ - public function findAllIterator(): IterableResult + public function findAllIterator(): iterable { /** @var Query $query */ $query = $this->createQuery(); $this->addAssetVariantToQueryConstraints($query); - return $query->getQueryBuilder()->getQuery()->iterate(); + return $query->getQueryBuilder()->getQuery()->toIterable(); } /** diff --git a/Neos.Media/Classes/Domain/Repository/ThumbnailRepository.php b/Neos.Media/Classes/Domain/Repository/ThumbnailRepository.php index abe2554357b..52c41210f20 100644 --- a/Neos.Media/Classes/Domain/Repository/ThumbnailRepository.php +++ b/Neos.Media/Classes/Domain/Repository/ThumbnailRepository.php @@ -13,7 +13,6 @@ use Doctrine\DBAL\Exception as DBALException; use Doctrine\ORM\EntityManagerInterface; -use Doctrine\ORM\Internal\Hydration\IterableResult; use Doctrine\ORM\QueryBuilder; use Neos\Flow\Annotations as Flow; use Neos\Flow\Log\Utility\LogEnvironment; @@ -45,37 +44,13 @@ class ThumbnailRepository extends Repository * @var LoggerInterface */ protected $logger; - - /** - * Iterate over an IterableResult and return a Generator - * - * This method is useful for batch processing huge result set as it clears the object - * manager and detaches the current object on each iteration. - * - * @param IterableResult $iterator - * @param callable $callback - * @return \Generator - */ - public function iterate(IterableResult $iterator, callable $callback = null): ?\Generator - { - $iteration = 0; - foreach ($iterator as $object) { - $object = current($object); - yield $object; - if ($callback !== null) { - $callback($iteration, $object); - } - $iteration++; - } - } - /** - * Find all objects and return an IterableResult + * Find all objects and return an iterable * * @param string $configurationHash Optional filtering by configuration hash (preset) - * @return IterableResult + * @return iterable */ - public function findAllIterator($configurationHash = null): IterableResult + public function findAllIterator($configurationHash = null): iterable { /** @var QueryBuilder $queryBuilder */ $queryBuilder = $this->entityManager->createQueryBuilder(); @@ -87,15 +62,15 @@ public function findAllIterator($configurationHash = null): IterableResult ->where('t.configurationHash = :configurationHash') ->setParameter('configurationHash', $configurationHash); } - return $queryBuilder->getQuery()->iterate(); + return $queryBuilder->getQuery()->toIterable(); } /** - * Find ungenerated objects and return an IterableResult + * Find ungenerated objects and return an iterable * - * @return IterableResult + * @return iterable */ - public function findUngeneratedIterator(): IterableResult + public function findUngeneratedIterator(): iterable { /** @var QueryBuilder $queryBuilder */ $queryBuilder = $this->entityManager->createQueryBuilder(); @@ -103,7 +78,7 @@ public function findUngeneratedIterator(): IterableResult ->select('t') ->from($this->getEntityClassName(), 't') ->where('t.resource IS NULL AND t.staticResource IS NULL'); - return $queryBuilder->getQuery()->iterate(); + return $queryBuilder->getQuery()->toIterable(); } /** diff --git a/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathSchemaBuilder.php b/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathSchemaBuilder.php index 8a4e755e8a9..0d7a02dcfb9 100644 --- a/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathSchemaBuilder.php +++ b/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathSchemaBuilder.php @@ -42,16 +42,16 @@ private function createUriTable(): Table { $table = new Table($this->tableNamePrefix . '_uri', [ DbalSchemaFactory::columnForNodeAggregateId('nodeaggregateid')->setNotNull(true), - (new Column('uripath', Type::getType(Types::STRING)))->setLength(4000)->setDefault('')->setNotnull(true)->setCustomSchemaOption('collation', self::DEFAULT_TEXT_COLLATION), + (new Column('uripath', Type::getType(Types::STRING)))->setLength(4000)->setDefault('')->setNotnull(true)->setPlatformOption('collation', self::DEFAULT_TEXT_COLLATION), DbalSchemaFactory::columnForDimensionSpacePointHash('dimensionspacepointhash')->setNotNull(true), (new Column('disabled', Type::getType(Types::INTEGER)))->setLength(4)->setUnsigned(true)->setDefault(0)->setNotnull(true), - (new Column('nodeaggregateidpath', Type::getType(Types::STRING)))->setLength(4000)->setDefault('')->setNotnull(true)->setCustomSchemaOption('collation', self::DEFAULT_TEXT_COLLATION), - (new Column('sitenodename', Type::getType(Types::STRING)))->setLength(255)->setDefault('')->setNotnull(true)->setCustomSchemaOption('collation', self::DEFAULT_TEXT_COLLATION), + (new Column('nodeaggregateidpath', Type::getType(Types::STRING)))->setLength(4000)->setDefault('')->setNotnull(true)->setPlatformOption('collation', self::DEFAULT_TEXT_COLLATION), + (new Column('sitenodename', Type::getType(Types::STRING)))->setLength(255)->setDefault('')->setNotnull(true)->setPlatformOption('collation', self::DEFAULT_TEXT_COLLATION), DbalSchemaFactory::columnForDimensionSpacePointHash('origindimensionspacepointhash')->setNotNull(true), DbalSchemaFactory::columnForNodeAggregateId('parentnodeaggregateid')->setNotNull(false), DbalSchemaFactory::columnForNodeAggregateId('precedingnodeaggregateid')->setNotNull(false), DbalSchemaFactory::columnForNodeAggregateId('succeedingnodeaggregateid')->setNotNull(false), - (new Column('shortcuttarget', Type::getType(Types::STRING)))->setLength(1000)->setNotnull(false)->setCustomSchemaOption('collation', self::DEFAULT_TEXT_COLLATION), + (new Column('shortcuttarget', Type::getType(Types::STRING)))->setLength(1000)->setNotnull(false)->setPlatformOption('collation', self::DEFAULT_TEXT_COLLATION), DbalSchemaFactory::columnForNodeTypeName('nodetypename') ]); diff --git a/Neos.Neos/Classes/PendingChangesProjection/ChangeProjection.php b/Neos.Neos/Classes/PendingChangesProjection/ChangeProjection.php index 6ac8719b3cc..9cf84bdf4aa 100644 --- a/Neos.Neos/Classes/PendingChangesProjection/ChangeProjection.php +++ b/Neos.Neos/Classes/PendingChangesProjection/ChangeProjection.php @@ -148,7 +148,7 @@ private function determineRequiredSqlStatements(): array $liveContentStreamsTable = new Table($this->tableNamePrefix . '_livecontentstreams', [ DbalSchemaFactory::ColumnForContentStreamId('contentstreamid')->setNotNull(true), - (new Column('workspacename', Type::getType(Types::STRING)))->setLength(255)->setDefault('')->setNotnull(true)->setCustomSchemaOption('collation', self::DEFAULT_TEXT_COLLATION) + (new Column('workspacename', Type::getType(Types::STRING)))->setLength(255)->setDefault('')->setNotnull(true)->setPlatformOption('collation', self::DEFAULT_TEXT_COLLATION) ]); $liveContentStreamsTable->setPrimaryKey(['contentstreamid']); From a7238d83cb3ba22cbc78fc1e954124d9fe9be567 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Mu=CC=88ller?= Date: Wed, 10 Jul 2024 09:35:10 +0200 Subject: [PATCH 8/8] Fix style error --- Neos.Media/Classes/Command/MediaCommandController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Neos.Media/Classes/Command/MediaCommandController.php b/Neos.Media/Classes/Command/MediaCommandController.php index 6eca3d1b9a3..11c6bfc5021 100644 --- a/Neos.Media/Classes/Command/MediaCommandController.php +++ b/Neos.Media/Classes/Command/MediaCommandController.php @@ -364,8 +364,8 @@ public function clearThumbnailsCommand(string $preset = null, bool $quiet = fals !$quiet && $this->output->progressStart($thumbnailCount); foreach ($iterator as $iteration => $thumbnail) { $this->thumbnailRepository->remove($thumbnail); - $this->persistAll($iteration); - !$quiet && $this->output->progressAdvance(1); + $this->persistAll($iteration); + !$quiet && $this->output->progressAdvance(1); } !$quiet && $this->output->progressFinish(); !$quiet && $this->output->outputLine();