Skip to content

Commit 2d84164

Browse files
committed
fix-db16-collection-creation
1 parent 0859d86 commit 2d84164

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/Database/Database.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1288,7 +1288,14 @@ public function createCollection(string $id, array $attributes = [], array $inde
12881288
}
12891289
}
12901290

1291-
$this->adapter->createCollection($id, $attributes, $indexes);
1291+
try {
1292+
$this->adapter->createCollection($id, $attributes, $indexes);
1293+
} catch (DuplicateException $e) {
1294+
// HACK: Metadata should still be updated, can be removed when null tenant collections are supported.
1295+
if (!$this->adapter->getSharedTables() || !$this->isMigrating()) {
1296+
throw $e;
1297+
}
1298+
}
12921299

12931300
if ($id === self::METADATA) {
12941301
return new Document(self::COLLECTION);

0 commit comments

Comments
 (0)