Skip to content

Commit

Permalink
Merge pull request #5089 from neos/bugfix/5008-reset-projections-afte…
Browse files Browse the repository at this point in the history
…r-setup

TASK: Remove `--reset-projections` flag from `cr:setup` command
  • Loading branch information
kdambekalns authored Jun 13, 2024
2 parents 9b78eee + 5a092d0 commit 332244b
Showing 1 changed file with 1 addition and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,11 @@ 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);

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('<comment>Abort.</comment>');
return;
}

$projectionService = $this->contentRepositoryRegistry->buildService($contentRepositoryId, $this->projectionServiceFactory);
$projectionService->resetAllProjections();
$this->outputLine('<success>All projections of Content Repository "%s" were resettet.</success>', [$contentRepositoryId->value]);
}

$this->contentRepositoryRegistry->get($contentRepositoryId)->setUp();
$this->outputLine('<success>Content Repository "%s" was set up</success>', [$contentRepositoryId->value]);
}
Expand Down

0 comments on commit 332244b

Please sign in to comment.