Skip to content

Commit

Permalink
Drop collection only if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
codeliner committed Jul 24, 2018
1 parent e76ff8f commit 9480bae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Projecting/AggregateProjector.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ public function prepareForRun(string $appVersion, string $projectionName): void

public function deleteReadModel(string $appVersion, string $projectionName): void
{
$this->documentStore->dropCollection($this->generateCollectionName($appVersion, $projectionName));
if ($this->documentStore->hasCollection(self::generateCollectionName($appVersion, $projectionName))) {
$this->documentStore->dropCollection(self::generateCollectionName($appVersion, $projectionName));
}
}

private function assertProjectionNameMatchesWithAggregateType(string $projectionName, string $aggregateType): void
Expand Down

0 comments on commit 9480bae

Please sign in to comment.