From c0ea2c071e0f828c87b3abddd7d6a7e56ba82dba Mon Sep 17 00:00:00 2001 From: Bastian Waidelich Date: Fri, 24 May 2024 13:20:05 +0200 Subject: [PATCH 1/2] BUGFIX: Reset projections after setup in `cr:setup` command Fixes: #5008 --- .../Classes/Command/CrCommandController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Neos.ContentRepositoryRegistry/Classes/Command/CrCommandController.php b/Neos.ContentRepositoryRegistry/Classes/Command/CrCommandController.php index b5d98b29e8e..7696dbbd19a 100644 --- a/Neos.ContentRepositoryRegistry/Classes/Command/CrCommandController.php +++ b/Neos.ContentRepositoryRegistry/Classes/Command/CrCommandController.php @@ -44,6 +44,9 @@ public function setupCommand(string $contentRepository = 'default', bool $resetP { $contentRepositoryId = ContentRepositoryId::fromString($contentRepository); + $this->contentRepositoryRegistry->get($contentRepositoryId)->setUp(); + $this->outputLine('Content Repository "%s" was set up', [$contentRepositoryId->value]); + if ($resetProjections) { if (!$this->output->askConfirmation(sprintf('> Advanced Mode. The flag --reset-projections will reset all projections in "%s", which leaves you with empty projections to be replayed. Are you sure to proceed? (y/n) ', $contentRepositoryId->value), false)) { $this->outputLine('Abort.'); @@ -54,9 +57,6 @@ public function setupCommand(string $contentRepository = 'default', bool $resetP $projectionService->resetAllProjections(); $this->outputLine('All projections of Content Repository "%s" were resettet.', [$contentRepositoryId->value]); } - - $this->contentRepositoryRegistry->get($contentRepositoryId)->setUp(); - $this->outputLine('Content Repository "%s" was set up', [$contentRepositoryId->value]); } /** From 5a092d0536b6420e1a5f5af0bbe5a18e1f1b25df Mon Sep 17 00:00:00 2001 From: Bastian Waidelich Date: Sat, 25 May 2024 14:12:08 +0200 Subject: [PATCH 2/2] Remove `--reset-projections` flag --- .../Classes/Command/CrCommandController.php | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/Neos.ContentRepositoryRegistry/Classes/Command/CrCommandController.php b/Neos.ContentRepositoryRegistry/Classes/Command/CrCommandController.php index 7696dbbd19a..47ab58afc2a 100644 --- a/Neos.ContentRepositoryRegistry/Classes/Command/CrCommandController.php +++ b/Neos.ContentRepositoryRegistry/Classes/Command/CrCommandController.php @@ -38,25 +38,13 @@ public function __construct( * That command will also display information what is about to be migrated. * * @param string $contentRepository Identifier of the Content Repository to set up - * @param bool $resetProjections Advanced. Can be used in rare cases when the projections cannot be migrated to reset everything in advance. This requires a full replay afterwards. */ - public function setupCommand(string $contentRepository = 'default', bool $resetProjections = false): void + public function setupCommand(string $contentRepository = 'default'): void { $contentRepositoryId = ContentRepositoryId::fromString($contentRepository); $this->contentRepositoryRegistry->get($contentRepositoryId)->setUp(); $this->outputLine('Content Repository "%s" was set up', [$contentRepositoryId->value]); - - if ($resetProjections) { - if (!$this->output->askConfirmation(sprintf('> Advanced Mode. The flag --reset-projections will reset all projections in "%s", which leaves you with empty projections to be replayed. Are you sure to proceed? (y/n) ', $contentRepositoryId->value), false)) { - $this->outputLine('Abort.'); - return; - } - - $projectionService = $this->contentRepositoryRegistry->buildService($contentRepositoryId, $this->projectionServiceFactory); - $projectionService->resetAllProjections(); - $this->outputLine('All projections of Content Repository "%s" were resettet.', [$contentRepositoryId->value]); - } } /**