Skip to content

Commit fa3b6ff

Browse files
committed
Fix partial failure recreate
1 parent f84590d commit fa3b6ff

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/Database/Database.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1799,7 +1799,10 @@ public function createCollection(string $id, array $attributes = [], array $inde
17991799
// Metadata check (above) already verified collection is absent
18001800
// from metadata. A DuplicateException from the adapter means the
18011801
// collection exists only in physical schema — an orphan from a prior
1802-
// partial failure. Skip creation and proceed to metadata creation.
1802+
// partial failure. Drop and recreate to ensure schema matches.
1803+
$this->adapter->deleteCollection($id);
1804+
$this->adapter->createCollection($id, $attributes, $indexes);
1805+
$created = true;
18031806
}
18041807

18051808
if ($id === self::METADATA) {

0 commit comments

Comments
 (0)