Skip to content

Commit 24f97a1

Browse files
committed
Ensure tenant isn't being changed at app level
1 parent 453cd2b commit 24f97a1

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/Database/Database.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4703,6 +4703,9 @@ public function createOrUpdateDocumentsWithIncrease(
47034703
if ($document->getTenant() === null) {
47044704
throw new DatabaseException('Missing tenant. Tenant must be set when tenant per document is enabled.');
47054705
}
4706+
if (!$old->isEmpty() && $old->getTenant() !== $document->getTenant()) {
4707+
throw new DatabaseException('Tenant cannot be changed.');
4708+
}
47064709
} else {
47074710
$document->setAttribute('$tenant', $this->adapter->getTenant());
47084711
}

0 commit comments

Comments
 (0)