Skip to content
5 changes: 4 additions & 1 deletion src/Database/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -1799,7 +1799,10 @@ public function createCollection(string $id, array $attributes = [], array $inde
// Metadata check (above) already verified collection is absent
// from metadata. A DuplicateException from the adapter means the
// collection exists only in physical schema — an orphan from a prior
// partial failure. Skip creation and proceed to metadata creation.
// partial failure. Drop and recreate to ensure schema matches.
$this->adapter->deleteCollection($id);
$this->adapter->createCollection($id, $attributes, $indexes);
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Comment thread
abnegate marked this conversation as resolved.
$created = true;
}

if ($id === self::METADATA) {
Expand Down
Loading