diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php index 527ed421d96..e6674618bfb 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php @@ -733,7 +733,6 @@ private function whenWorkspaceBaseWorkspaceWasChanged(WorkspaceBaseWorkspaceWasC private function whenWorkspaceRebaseFailed(WorkspaceRebaseFailed $event): void { - $this->markWorkspaceAsOutdatedConflict($event->workspaceName); $this->updateContentStreamStatus($event->candidateContentStreamId, ContentStreamStatus::REBASE_ERROR); } @@ -748,8 +747,6 @@ private function whenWorkspaceWasCreated(WorkspaceWasCreated $event): void private function whenWorkspaceWasDiscarded(WorkspaceWasDiscarded $event): void { $this->updateWorkspaceContentStreamId($event->workspaceName, $event->newContentStreamId); - $this->markWorkspaceAsOutdated($event->workspaceName); - $this->markDependentWorkspacesAsOutdated($event->workspaceName); // the new content stream is in use now $this->updateContentStreamStatus($event->newContentStreamId, ContentStreamStatus::IN_USE_BY_WORKSPACE); @@ -760,7 +757,6 @@ private function whenWorkspaceWasDiscarded(WorkspaceWasDiscarded $event): void private function whenWorkspaceWasPartiallyDiscarded(WorkspaceWasPartiallyDiscarded $event): void { $this->updateWorkspaceContentStreamId($event->workspaceName, $event->newContentStreamId); - $this->markDependentWorkspacesAsOutdated($event->workspaceName); // the new content stream is in use now $this->updateContentStreamStatus($event->newContentStreamId, ContentStreamStatus::IN_USE_BY_WORKSPACE); @@ -773,12 +769,6 @@ private function whenWorkspaceWasPartiallyPublished(WorkspaceWasPartiallyPublish { // TODO: How do we test this method? – It's hard to design a BDD testcase that fails if this method is commented out... $this->updateWorkspaceContentStreamId($event->sourceWorkspaceName, $event->newSourceContentStreamId); - $this->markDependentWorkspacesAsOutdated($event->targetWorkspaceName); - - // NASTY: we need to set the source workspace name as non-outdated; as it has been made up-to-date again. - $this->markWorkspaceAsUpToDate($event->sourceWorkspaceName); - - $this->markDependentWorkspacesAsOutdated($event->sourceWorkspaceName); // the new content stream is in use now $this->updateContentStreamStatus($event->newSourceContentStreamId, ContentStreamStatus::IN_USE_BY_WORKSPACE); @@ -791,12 +781,6 @@ private function whenWorkspaceWasPublished(WorkspaceWasPublished $event): void { // TODO: How do we test this method? – It's hard to design a BDD testcase that fails if this method is commented out... $this->updateWorkspaceContentStreamId($event->sourceWorkspaceName, $event->newSourceContentStreamId); - $this->markDependentWorkspacesAsOutdated($event->targetWorkspaceName); - - // NASTY: we need to set the source workspace name as non-outdated; as it has been made up-to-date again. - $this->markWorkspaceAsUpToDate($event->sourceWorkspaceName); - - $this->markDependentWorkspacesAsOutdated($event->sourceWorkspaceName); // the new content stream is in use now $this->updateContentStreamStatus($event->newSourceContentStreamId, ContentStreamStatus::IN_USE_BY_WORKSPACE); @@ -808,10 +792,6 @@ private function whenWorkspaceWasPublished(WorkspaceWasPublished $event): void private function whenWorkspaceWasRebased(WorkspaceWasRebased $event): void { $this->updateWorkspaceContentStreamId($event->workspaceName, $event->newContentStreamId); - $this->markDependentWorkspacesAsOutdated($event->workspaceName); - - // When the rebase is successful, we can set the status of the workspace back to UP_TO_DATE. - $this->markWorkspaceAsUpToDate($event->workspaceName); // the new content stream is in use now $this->updateContentStreamStatus($event->newContentStreamId, ContentStreamStatus::IN_USE_BY_WORKSPACE); diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphSchemaBuilder.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphSchemaBuilder.php index 05dd58f0ae7..08ca2f8919a 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphSchemaBuilder.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphSchemaBuilder.php @@ -115,7 +115,6 @@ private function createWorkspaceTable(): Table DbalSchemaFactory::columnForWorkspaceName('name')->setNotnull(true), DbalSchemaFactory::columnForWorkspaceName('baseWorkspaceName')->setNotnull(false), DbalSchemaFactory::columnForContentStreamId('currentContentStreamId')->setNotNull(true), - (new Column('status', self::type(Types::BINARY)))->setLength(20)->setNotnull(false), ]); return $workspaceTable->setPrimaryKey(['name']); diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/Workspace.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/Workspace.php index 5f1e744ef96..882e4469f96 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/Workspace.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/Workspace.php @@ -4,7 +4,6 @@ namespace Neos\ContentGraph\DoctrineDbalAdapter\Domain\Projection\Feature; -use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceStatus; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; @@ -20,8 +19,7 @@ private function createWorkspace(WorkspaceName $workspaceName, ?WorkspaceName $b $this->dbal->insert($this->tableNames->workspace(), [ 'name' => $workspaceName->value, 'baseWorkspaceName' => $baseWorkspaceName?->value, - 'currentContentStreamId' => $contentStreamId->value, - 'status' => WorkspaceStatus::UP_TO_DATE->value + 'currentContentStreamId' => $contentStreamId->value ]); } @@ -55,58 +53,4 @@ private function updateWorkspaceContentStreamId( 'name' => $workspaceName->value ]); } - - private function markWorkspaceAsUpToDate(WorkspaceName $workspaceName): void - { - $this->dbal->executeStatement(' - UPDATE ' . $this->tableNames->workspace() . ' - SET status = :upToDate - WHERE - name = :workspaceName - ', [ - 'upToDate' => WorkspaceStatus::UP_TO_DATE->value, - 'workspaceName' => $workspaceName->value - ]); - } - - private function markDependentWorkspacesAsOutdated(WorkspaceName $baseWorkspaceName): void - { - $this->dbal->executeStatement(' - UPDATE ' . $this->tableNames->workspace() . ' - SET status = :outdated - WHERE - baseWorkspaceName = :baseWorkspaceName - ', [ - 'outdated' => WorkspaceStatus::OUTDATED->value, - 'baseWorkspaceName' => $baseWorkspaceName->value - ]); - } - - private function markWorkspaceAsOutdated(WorkspaceName $workspaceName): void - { - $this->dbal->executeStatement(' - UPDATE ' . $this->tableNames->workspace() . ' - SET - status = :outdated - WHERE - name = :workspaceName - ', [ - 'outdated' => WorkspaceStatus::OUTDATED->value, - 'workspaceName' => $workspaceName->value - ]); - } - - private function markWorkspaceAsOutdatedConflict(WorkspaceName $workspaceName): void - { - $this->dbal->executeStatement(' - UPDATE ' . $this->tableNames->workspace() . ' - SET - status = :outdatedConflict - WHERE - name = :workspaceName - ', [ - 'outdatedConflict' => WorkspaceStatus::OUTDATED_CONFLICT->value, - 'workspaceName' => $workspaceName->value - ]); - } } diff --git a/Neos.ContentRepository.Core/Classes/SharedModel/Workspace/WorkspaceStatus.php b/Neos.ContentRepository.Core/Classes/SharedModel/Workspace/WorkspaceStatus.php index 7c8d25067ff..5ef187bb1db 100644 --- a/Neos.ContentRepository.Core/Classes/SharedModel/Workspace/WorkspaceStatus.php +++ b/Neos.ContentRepository.Core/Classes/SharedModel/Workspace/WorkspaceStatus.php @@ -47,18 +47,6 @@ enum WorkspaceStatus: string implements \JsonSerializable */ case OUTDATED = 'OUTDATED'; - /** - * CONFLICT Example: - * - * CONFLICT is a special case of OUTDATED, but then an error happens during the rebasing. - * - * Workspace Review <----------------------------------- Workspace User-Foo - * | . | - * Content Stream A2 (current) <-- Content Stream B2 (rebasing) | - * Content Stream B1 - */ - case OUTDATED_CONFLICT = 'OUTDATED_CONFLICT'; - public function equals(self $other): bool { return $this->value === $other->value;