Skip to content

Commit cff2b6e

Browse files
authored
Merge pull request #843 from utopia-php/fix-metadata-reconciliation
2 parents f121418 + b6c7176 commit cff2b6e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Database/Database.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1796,8 +1796,10 @@ public function createCollection(string $id, array $attributes = [], array $inde
17961796
$this->adapter->createCollection($id, $attributes, $indexes);
17971797
$createdPhysicalTable = true;
17981798
} catch (DuplicateException $e) {
1799-
if ($this->adapter->getSharedTables()
1800-
&& ($id === self::METADATA || $this->adapter->exists($this->adapter->getDatabase(), $id))) {
1799+
if ($id === self::METADATA
1800+
|| ($this->adapter->getSharedTables()
1801+
&& $this->adapter->exists($this->adapter->getDatabase(), $id))) {
1802+
// The metadata table must never be dropped during reconciliation.
18011803
// In shared-tables mode the physical table is reused across
18021804
// tenants. A DuplicateException simply means the table already
18031805
// exists for another tenant — not an orphan.

0 commit comments

Comments
 (0)