Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TASK: Remove --reset-projections flag from cr:setup command #5089

Merged
merged 2 commits into from
Jun 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading