diff --git a/src/Database/Adapter.php b/src/Database/Adapter.php index 16b491152..861826c67 100644 --- a/src/Database/Adapter.php +++ b/src/Database/Adapter.php @@ -747,12 +747,12 @@ abstract public function deleteDocument(string $collection, string $id): bool; * Delete Documents * * @param string $collection - * @param array $internalIds + * @param array $sequences * @param array $permissionIds * * @return int */ - abstract public function deleteDocuments(string $collection, array $internalIds, array $permissionIds): int; + abstract public function deleteDocuments(string $collection, array $sequences, array $permissionIds): int; /** * Find Documents diff --git a/src/Database/Adapter/MariaDB.php b/src/Database/Adapter/MariaDB.php index 1c240e18c..ce9a04503 100644 --- a/src/Database/Adapter/MariaDB.php +++ b/src/Database/Adapter/MariaDB.php @@ -905,10 +905,10 @@ public function createDocument(string $collection, Document $document): Document $stmt->execute(); - $document['$internalId'] = $this->pdo->lastInsertId(); + $document['$sequence'] = $this->pdo->lastInsertId(); - if (empty($document['$internalId'])) { - throw new DatabaseException('Error creating document empty "$internalId"'); + if (empty($document['$sequence'])) { + throw new DatabaseException('Error creating document empty "$sequence"'); } if (isset($stmtPermissions)) { @@ -1051,15 +1051,15 @@ public function createDocuments(string $collection, array $documents): array $stmtPermissions?->execute(); } - $internalIds = $this->getInternalIds( + $sequences = $this->getInternalIds( $collection, $documentIds, $documentTenants ); foreach ($documents as $document) { - if (isset($internalIds[$document->getId()])) { - $document['$internalId'] = $internalIds[$document->getId()]; + if (isset($sequences[$document->getId()])) { + $document['$sequence'] = $sequences[$document->getId()]; } } } catch (PDOException $e) { @@ -1495,15 +1495,15 @@ public function createOrUpdateDocuments( $stmtAddPermissions->execute(); } - $internalIds = $this->getInternalIds( + $sequences = $this->getInternalIds( $collection, $documentIds, $documentTenants ); foreach ($changes as $change) { - if (isset($internalIds[$change->getNew()->getId()])) { - $change->getNew()->setAttribute('$internalId', $internalIds[$change->getNew()->getId()]); + if (isset($sequences[$change->getNew()->getId()])) { + $change->getNew()->setAttribute('$sequence', $sequences[$change->getNew()->getId()]); } } } catch (PDOException $e) { @@ -1686,7 +1686,7 @@ public function find(string $collection, array $queries = [], ?int $limit = 25, OR ( {$this->quote($alias)}.{$this->quote($attribute)} = :cursor AND - {$this->quote($alias)}._id {$this->getSQLOperator($orderMethodInternalId)} {$cursor['$internalId']} + {$this->quote($alias)}._id {$this->getSQLOperator($orderMethodInternalId)} {$cursor['$sequence']} ) )"; } elseif ($cursorDirection === Database::CURSOR_BEFORE) { @@ -1710,7 +1710,7 @@ public function find(string $collection, array $queries = [], ?int $limit = 25, : Query::TYPE_LESSER; } - $where[] = "({$this->quote($alias)}._id {$this->getSQLOperator($orderMethod)} {$cursor['$internalId']})"; + $where[] = "({$this->quote($alias)}._id {$this->getSQLOperator($orderMethod)} {$cursor['$sequence']})"; } // Allow order type without any order attribute, fallback to the natural order (_id) @@ -1788,7 +1788,7 @@ public function find(string $collection, array $queries = [], ?int $limit = 25, unset($results[$index]['_uid']); } if (\array_key_exists('_id', $document)) { - $results[$index]['$internalId'] = $document['_id']; + $results[$index]['$sequence'] = $document['_id']; unset($results[$index]['_id']); } if (\array_key_exists('_tenant', $document)) { diff --git a/src/Database/Adapter/Pool.php b/src/Database/Adapter/Pool.php index c7ba9c1a8..e863e8d7e 100644 --- a/src/Database/Adapter/Pool.php +++ b/src/Database/Adapter/Pool.php @@ -255,7 +255,7 @@ public function deleteDocument(string $collection, string $id): bool return $this->delegate(__FUNCTION__, \func_get_args()); } - public function deleteDocuments(string $collection, array $internalIds, array $permissionIds): int + public function deleteDocuments(string $collection, array $sequences, array $permissionIds): int { return $this->delegate(__FUNCTION__, \func_get_args()); } diff --git a/src/Database/Adapter/Postgres.php b/src/Database/Adapter/Postgres.php index 8678afcaa..fe6ff68bf 100644 --- a/src/Database/Adapter/Postgres.php +++ b/src/Database/Adapter/Postgres.php @@ -1030,7 +1030,7 @@ public function createDocument(string $collection, Document $document): Document $this->execute($stmt); $lastInsertedId = $this->getPDO()->lastInsertId(); // internalId can be manually as well - $document['$internalId'] ??= $lastInsertedId; + $document['$sequence'] ??= $lastInsertedId; if (isset($stmtPermissions)) { $this->execute($stmtPermissions); @@ -1085,7 +1085,7 @@ public function createDocuments(string $collection, array $documents): array } $columns = '(' . \implode(', ', $columns) . ')'; - $internalIds = []; + $sequences = []; $bindIndex = 0; $batchKeys = []; @@ -1100,7 +1100,7 @@ public function createDocuments(string $collection, array $documents): array $attributes['_permissions'] = \json_encode($document->getPermissions()); if (!empty($document->getInternalId())) { - $internalIds[$document->getId()] = true; + $sequences[$document->getId()] = true; $attributes['_id'] = $document->getInternalId(); $attributeKeys[] = '_id'; } @@ -1172,11 +1172,11 @@ public function createDocuments(string $collection, array $documents): array } foreach ($documents as $document) { - if (!isset($internalIds[$document->getId()])) { - $document['$internalId'] = $this->getDocument( + if (!isset($sequences[$document->getId()])) { + $document['$sequence'] = $this->getDocument( $collection, $document->getId(), - [Query::select(['$internalId'])] + [Query::select(['$sequence'])] )->getInternalId(); } } @@ -1578,7 +1578,7 @@ public function find(string $collection, array $queries = [], ?int $limit = 25, OR ( {$this->quote($alias)}.{$this->quote($attribute)} = :cursor AND - {$this->quote($alias)}._id {$this->getSQLOperator($orderMethodInternalId)} {$cursor['$internalId']} + {$this->quote($alias)}._id {$this->getSQLOperator($orderMethodInternalId)} {$cursor['$sequence']} ) )"; } elseif ($cursorDirection === Database::CURSOR_BEFORE) { @@ -1602,7 +1602,7 @@ public function find(string $collection, array $queries = [], ?int $limit = 25, : Query::TYPE_LESSER; } - $where[] = "({$this->quote($alias)}._id {$this->getSQLOperator($orderMethod)} {$cursor['$internalId']})"; + $where[] = "({$this->quote($alias)}._id {$this->getSQLOperator($orderMethod)} {$cursor['$sequence']})"; } // Allow order type without any order attribute, fallback to the natural order (_id) @@ -1683,7 +1683,7 @@ public function find(string $collection, array $queries = [], ?int $limit = 25, unset($results[$index]['_uid']); } if (\array_key_exists('_id', $document)) { - $results[$index]['$internalId'] = $document['_id']; + $results[$index]['$sequence'] = $document['_id']; unset($results[$index]['_id']); } if (\array_key_exists('_tenant', $document)) { diff --git a/src/Database/Adapter/SQL.php b/src/Database/Adapter/SQL.php index 1d97f9c52..17f2a46a1 100644 --- a/src/Database/Adapter/SQL.php +++ b/src/Database/Adapter/SQL.php @@ -367,7 +367,7 @@ public function getDocument(string $collection, string $id, array $queries = [], $document = $document[0]; if (\array_key_exists('_id', $document)) { - $document['$internalId'] = $document['_id']; + $document['$sequence'] = $document['_id']; unset($document['_id']); } if (\array_key_exists('_uid', $document)) { @@ -441,12 +441,12 @@ public function updateDocuments(string $collection, Document $updates, array $do } $name = $this->filter($collection); - $internalIds = \array_map(fn ($document) => $document->getInternalId(), $documents); + $sequences = \array_map(fn ($document) => $document->getInternalId(), $documents); $sql = " UPDATE {$this->getSQLTable($name)} SET {$columns} - WHERE _id IN (" . \implode(', ', \array_map(fn ($index) => ":_id_{$index}", \array_keys($internalIds))) . ") + WHERE _id IN (" . \implode(', ', \array_map(fn ($index) => ":_id_{$index}", \array_keys($sequences))) . ") {$this->getTenantQuery($collection)} "; @@ -457,7 +457,7 @@ public function updateDocuments(string $collection, Document $updates, array $do $stmt->bindValue(':_tenant', $this->tenant); } - foreach ($internalIds as $id => $value) { + foreach ($sequences as $id => $value) { $stmt->bindValue(":_id_{$id}", $value); } @@ -640,15 +640,15 @@ public function updateDocuments(string $collection, Document $updates, array $do * Delete Documents * * @param string $collection - * @param array $internalIds + * @param array $sequences * @param array $permissionIds * * @return int * @throws DatabaseException */ - public function deleteDocuments(string $collection, array $internalIds, array $permissionIds): int + public function deleteDocuments(string $collection, array $sequences, array $permissionIds): int { - if (empty($internalIds)) { + if (empty($sequences)) { return 0; } @@ -657,7 +657,7 @@ public function deleteDocuments(string $collection, array $internalIds, array $p $sql = " DELETE FROM {$this->getSQLTable($name)} - WHERE _id IN (" . \implode(', ', \array_map(fn ($index) => ":_id_{$index}", \array_keys($internalIds))) . ") + WHERE _id IN (" . \implode(', ', \array_map(fn ($index) => ":_id_{$index}", \array_keys($sequences))) . ") {$this->getTenantQuery($collection)} "; @@ -665,7 +665,7 @@ public function deleteDocuments(string $collection, array $internalIds, array $p $stmt = $this->getPDO()->prepare($sql); - foreach ($internalIds as $id => $value) { + foreach ($sequences as $id => $value) { $stmt->bindValue(":_id_{$id}", $value); } @@ -718,7 +718,7 @@ public function deleteDocuments(string $collection, array $internalIds, array $p */ protected function getInternalIds(string $collection, array $documentIds, array $documentTenants = []): array { - $internalIds = []; + $sequences = []; /** * UID, _tenant bottleneck is ~ 5000 rows since we use _uid IN query @@ -747,10 +747,10 @@ protected function getInternalIds(string $collection, array $documentIds, array $results = $stmt->fetchAll(\PDO::FETCH_KEY_PAIR); // Fetch as [documentId => internalId] $stmt->closeCursor(); - $internalIds = [...$internalIds, ...$results]; + $sequences = [...$sequences, ...$results]; } - return $internalIds; + return $sequences; } /** @@ -1692,7 +1692,7 @@ protected function getAttributeProjection(array $selections, string $prefix = '' $internalKeys = [ '$id', - '$internalId', + '$sequence', '$permissions', '$createdAt', '$updatedAt', @@ -1721,7 +1721,7 @@ protected function getInternalKeyForAttribute(string $attribute): string { return match ($attribute) { '$id' => '_uid', - '$internalId' => '_id', + '$sequence' => '_id', '$collection' => '_collection', '$tenant' => '_tenant', '$createdAt' => '_createdAt', diff --git a/src/Database/Adapter/SQLite.php b/src/Database/Adapter/SQLite.php index 344199095..5f68b61db 100644 --- a/src/Database/Adapter/SQLite.php +++ b/src/Database/Adapter/SQLite.php @@ -609,7 +609,7 @@ public function createDocument(string $collection, Document $document): Document $statment->execute(); $last = $statment->fetch(); - $document['$internalId'] = $last['id']; + $document['$sequence'] = $last['id']; if (isset($stmtPermissions)) { $stmtPermissions->execute(); diff --git a/src/Database/Database.php b/src/Database/Database.php index 32b13a6c6..2bccb5799 100644 --- a/src/Database/Database.php +++ b/src/Database/Database.php @@ -163,7 +163,7 @@ class Database 'filters' => [], ], [ - '$id' => '$internalId', + '$id' => '$sequence', 'type' => self::VAR_STRING, 'size' => Database::LENGTH_KEY, 'required' => true, @@ -5788,10 +5788,10 @@ public function deleteDocuments( break; } - $internalIds = []; + $sequences = []; $permissionIds = []; foreach ($batch as $document) { - $internalIds[] = $document->getInternalId(); + $sequences[] = $document->getInternalId(); if (!empty($document->getPermissions())) { $permissionIds[] = $document->getId(); } @@ -5815,10 +5815,10 @@ public function deleteDocuments( } } - $this->withTransaction(function () use ($collection, $internalIds, $permissionIds) { + $this->withTransaction(function () use ($collection, $sequences, $permissionIds) { $this->adapter->deleteDocuments( $collection->getId(), - $internalIds, + $sequences, $permissionIds ); }); @@ -6539,7 +6539,7 @@ private function validateSelections(Document $collection, array $queries): array $selections = \array_merge($selections, $relationshipSelections); $selections[] = '$id'; - $selections[] = '$internalId'; + $selections[] = '$sequence'; $selections[] = '$collection'; $selections[] = '$createdAt'; $selections[] = '$updatedAt'; diff --git a/src/Database/Document.php b/src/Database/Document.php index 688ee1c69..824ac6f8d 100644 --- a/src/Database/Document.php +++ b/src/Database/Document.php @@ -66,7 +66,7 @@ public function getId(): string */ public function getInternalId(): string { - return $this->getAttribute('$internalId', ''); + return $this->getAttribute('$sequence', ''); } /** diff --git a/src/Database/Query.php b/src/Database/Query.php index 745227401..90c15914f 100644 --- a/src/Database/Query.php +++ b/src/Database/Query.php @@ -89,7 +89,7 @@ class Query public function __construct(string $method, string $attribute = '', array $values = []) { if ($attribute === '' && \in_array($method, [Query::TYPE_ORDER_ASC, Query::TYPE_ORDER_DESC])) { - $attribute = '$internalId'; + $attribute = '$sequence'; } $this->method = $method; diff --git a/src/Database/Validator/Queries/Documents.php b/src/Database/Validator/Queries/Documents.php index abce8694f..4e5c13f5f 100644 --- a/src/Database/Validator/Queries/Documents.php +++ b/src/Database/Validator/Queries/Documents.php @@ -36,8 +36,8 @@ public function __construct( 'array' => false, ]); $attributes[] = new Document([ - '$id' => '$internalId', - 'key' => '$internalId', + '$id' => '$sequence', + 'key' => '$sequence', 'type' => Database::VAR_STRING, 'array' => false, ]); diff --git a/src/Database/Validator/Query/Select.php b/src/Database/Validator/Query/Select.php index 4233a492f..40572b828 100644 --- a/src/Database/Validator/Query/Select.php +++ b/src/Database/Validator/Query/Select.php @@ -20,7 +20,7 @@ class Select extends Base */ protected const INTERNAL_ATTRIBUTES = [ '$id', - '$internalId', + '$sequence', '$createdAt', '$updatedAt', '$permissions', diff --git a/src/Database/Validator/Structure.php b/src/Database/Validator/Structure.php index 8910b8088..478557697 100644 --- a/src/Database/Validator/Structure.php +++ b/src/Database/Validator/Structure.php @@ -31,7 +31,7 @@ class Structure extends Validator 'filters' => [], ], [ - '$id' => '$internalId', + '$id' => '$sequence', 'type' => Database::VAR_STRING, 'size' => 255, 'required' => false, diff --git a/tests/e2e/Adapter/Scopes/DocumentTests.php b/tests/e2e/Adapter/Scopes/DocumentTests.php index d1718f602..252884332 100644 --- a/tests/e2e/Adapter/Scopes/DocumentTests.php +++ b/tests/e2e/Adapter/Scopes/DocumentTests.php @@ -89,7 +89,7 @@ public function testCreateDocument(): Document // Test create document with manual internal id $manualIdDocument = static::getDatabase()->createDocument('documents', new Document([ '$id' => '56000', - '$internalId' => '56000', + '$sequence' => '56000', '$permissions' => [ Permission::read(Role::any()), Permission::read(Role::user(ID::custom('1'))), @@ -297,7 +297,7 @@ public function testCreateDocumentsWithDifferentAttributes(): void $documents = [ new Document([ '$id' => 'third', - '$internalId' => 'third', + '$sequence' => 'third', 'string' => 'text📝', ]), new Document([ @@ -788,7 +788,7 @@ public function testGetDocumentSelect(Document $document): Document $this->assertArrayNotHasKey('colors', $document->getAttributes()); $this->assertArrayNotHasKey('with-dash', $document->getAttributes()); $this->assertArrayHasKey('$id', $document); - $this->assertArrayHasKey('$internalId', $document); + $this->assertArrayHasKey('$sequence', $document); $this->assertArrayHasKey('$createdAt', $document); $this->assertArrayHasKey('$updatedAt', $document); $this->assertArrayHasKey('$permissions', $document); @@ -799,7 +799,7 @@ public function testGetDocumentSelect(Document $document): Document ]); $this->assertArrayHasKey('$id', $document); - $this->assertArrayHasKey('$internalId', $document); + $this->assertArrayHasKey('$sequence', $document); $this->assertArrayHasKey('$createdAt', $document); $this->assertArrayHasKey('$updatedAt', $document); $this->assertArrayHasKey('$permissions', $document); @@ -984,7 +984,7 @@ public function testFind(): array ])); return [ - '$internalId' => $document->getInternalId() + '$sequence' => $document->getInternalId() ]; } @@ -1387,7 +1387,7 @@ public function testFindByInternalID(array $data): void * Test that internal ID queries are handled correctly */ $documents = static::getDatabase()->find('movies', [ - Query::equal('$internalId', [$data['$internalId']]), + Query::equal('$sequence', [$data['$sequence']]), ]); $this->assertEquals(1, count($documents)); @@ -2321,7 +2321,7 @@ public function testFindSelect(): void $this->assertArrayNotHasKey('price', $document); $this->assertArrayNotHasKey('active', $document); $this->assertArrayHasKey('$id', $document); - $this->assertArrayHasKey('$internalId', $document); + $this->assertArrayHasKey('$sequence', $document); $this->assertArrayHasKey('$collection', $document); $this->assertArrayHasKey('$createdAt', $document); $this->assertArrayHasKey('$updatedAt', $document); @@ -2339,7 +2339,7 @@ public function testFindSelect(): void $this->assertArrayNotHasKey('price', $document); $this->assertArrayNotHasKey('active', $document); $this->assertArrayHasKey('$id', $document); - $this->assertArrayHasKey('$internalId', $document); + $this->assertArrayHasKey('$sequence', $document); $this->assertArrayHasKey('$collection', $document); $this->assertArrayHasKey('$createdAt', $document); $this->assertArrayHasKey('$updatedAt', $document); @@ -2347,7 +2347,7 @@ public function testFindSelect(): void } $documents = static::getDatabase()->find('movies', [ - Query::select(['name', 'year', '$internalId']) + Query::select(['name', 'year', '$sequence']) ]); foreach ($documents as $document) { @@ -2357,7 +2357,7 @@ public function testFindSelect(): void $this->assertArrayNotHasKey('price', $document); $this->assertArrayNotHasKey('active', $document); $this->assertArrayHasKey('$id', $document); - $this->assertArrayHasKey('$internalId', $document); + $this->assertArrayHasKey('$sequence', $document); $this->assertArrayHasKey('$collection', $document); $this->assertArrayHasKey('$createdAt', $document); $this->assertArrayHasKey('$updatedAt', $document); @@ -2375,7 +2375,7 @@ public function testFindSelect(): void $this->assertArrayNotHasKey('price', $document); $this->assertArrayNotHasKey('active', $document); $this->assertArrayHasKey('$id', $document); - $this->assertArrayHasKey('$internalId', $document); + $this->assertArrayHasKey('$sequence', $document); $this->assertArrayHasKey('$collection', $document); $this->assertArrayHasKey('$createdAt', $document); $this->assertArrayHasKey('$updatedAt', $document); @@ -2393,7 +2393,7 @@ public function testFindSelect(): void $this->assertArrayNotHasKey('price', $document); $this->assertArrayNotHasKey('active', $document); $this->assertArrayHasKey('$id', $document); - $this->assertArrayHasKey('$internalId', $document); + $this->assertArrayHasKey('$sequence', $document); $this->assertArrayHasKey('$collection', $document); $this->assertArrayHasKey('$createdAt', $document); $this->assertArrayHasKey('$updatedAt', $document); @@ -2411,7 +2411,7 @@ public function testFindSelect(): void $this->assertArrayNotHasKey('price', $document); $this->assertArrayNotHasKey('active', $document); $this->assertArrayHasKey('$id', $document); - $this->assertArrayHasKey('$internalId', $document); + $this->assertArrayHasKey('$sequence', $document); $this->assertArrayHasKey('$collection', $document); $this->assertArrayHasKey('$createdAt', $document); $this->assertArrayHasKey('$updatedAt', $document); @@ -2429,7 +2429,7 @@ public function testFindSelect(): void $this->assertArrayNotHasKey('price', $document); $this->assertArrayNotHasKey('active', $document); $this->assertArrayHasKey('$id', $document); - $this->assertArrayHasKey('$internalId', $document); + $this->assertArrayHasKey('$sequence', $document); $this->assertArrayHasKey('$collection', $document); $this->assertArrayHasKey('$createdAt', $document); $this->assertArrayHasKey('$updatedAt', $document); @@ -3381,7 +3381,7 @@ public function testDeleteBulkDocuments(): void /** * Test Short select query, test pagination as well, Add order to select */ - $selects = ['$internalId', '$id', '$collection', '$permissions', '$updatedAt']; + $selects = ['$sequence', '$id', '$collection', '$permissions', '$updatedAt']; $count = static::getDatabase()->deleteDocuments( collection: 'bulk_delete', @@ -3692,7 +3692,7 @@ public function testExceptionDuplicate(Document $document): void public function testExceptionCaseInsensitiveDuplicate(Document $document): Document { $document->setAttribute('$id', 'caseSensitive'); - $document->setAttribute('$internalId', '200'); + $document->setAttribute('$sequence', '200'); static::getDatabase()->createDocument($document->getCollection(), $document); $document->setAttribute('$id', 'CaseSensitive'); diff --git a/tests/e2e/Adapter/Scopes/RelationshipTests.php b/tests/e2e/Adapter/Scopes/RelationshipTests.php index a230650f4..e952c502d 100644 --- a/tests/e2e/Adapter/Scopes/RelationshipTests.php +++ b/tests/e2e/Adapter/Scopes/RelationshipTests.php @@ -962,7 +962,7 @@ public function testSelectRelationshipAttributes(): void $this->assertArrayNotHasKey('year', $make['models'][0]); $this->assertArrayNotHasKey('year', $make['models'][1]); $this->assertArrayHasKey('$id', $make); - $this->assertArrayHasKey('$internalId', $make); + $this->assertArrayHasKey('$sequence', $make); $this->assertArrayHasKey('$permissions', $make); $this->assertArrayHasKey('$collection', $make); $this->assertArrayHasKey('$createdAt', $make); @@ -979,14 +979,14 @@ public function testSelectRelationshipAttributes(): void $this->assertArrayHasKey('name', $make); $this->assertArrayHasKey('$id', $make); - $this->assertArrayHasKey('$internalId', $make); + $this->assertArrayHasKey('$sequence', $make); $this->assertArrayHasKey('$collection', $make); $this->assertArrayHasKey('$createdAt', $make); $this->assertArrayHasKey('$updatedAt', $make); $this->assertArrayHasKey('$permissions', $make); $make = static::getDatabase()->findOne('make', [ - Query::select(['name', '$internalId']), + Query::select(['name', '$sequence']), ]); if ($make->isEmpty()) { @@ -995,7 +995,7 @@ public function testSelectRelationshipAttributes(): void $this->assertArrayHasKey('name', $make); $this->assertArrayHasKey('$id', $make); - $this->assertArrayHasKey('$internalId', $make); + $this->assertArrayHasKey('$sequence', $make); $this->assertArrayHasKey('$collection', $make); $this->assertArrayHasKey('$createdAt', $make); $this->assertArrayHasKey('$updatedAt', $make); @@ -1011,7 +1011,7 @@ public function testSelectRelationshipAttributes(): void $this->assertArrayHasKey('name', $make); $this->assertArrayHasKey('$id', $make); - $this->assertArrayHasKey('$internalId', $make); + $this->assertArrayHasKey('$sequence', $make); $this->assertArrayHasKey('$collection', $make); $this->assertArrayHasKey('$createdAt', $make); $this->assertArrayHasKey('$updatedAt', $make); @@ -1027,7 +1027,7 @@ public function testSelectRelationshipAttributes(): void $this->assertArrayHasKey('name', $make); $this->assertArrayHasKey('$id', $make); - $this->assertArrayHasKey('$internalId', $make); + $this->assertArrayHasKey('$sequence', $make); $this->assertArrayHasKey('$collection', $make); $this->assertArrayHasKey('$createdAt', $make); $this->assertArrayHasKey('$updatedAt', $make); @@ -1043,7 +1043,7 @@ public function testSelectRelationshipAttributes(): void $this->assertArrayHasKey('name', $make); $this->assertArrayHasKey('$id', $make); - $this->assertArrayHasKey('$internalId', $make); + $this->assertArrayHasKey('$sequence', $make); $this->assertArrayHasKey('$collection', $make); $this->assertArrayHasKey('$createdAt', $make); $this->assertArrayHasKey('$updatedAt', $make); @@ -1059,7 +1059,7 @@ public function testSelectRelationshipAttributes(): void $this->assertArrayHasKey('name', $make); $this->assertArrayHasKey('$id', $make); - $this->assertArrayHasKey('$internalId', $make); + $this->assertArrayHasKey('$sequence', $make); $this->assertArrayHasKey('$collection', $make); $this->assertArrayHasKey('$createdAt', $make); $this->assertArrayHasKey('$updatedAt', $make); diff --git a/tests/unit/Validator/Query/OrderTest.php b/tests/unit/Validator/Query/OrderTest.php index 3a307171f..b84d896d1 100644 --- a/tests/unit/Validator/Query/OrderTest.php +++ b/tests/unit/Validator/Query/OrderTest.php @@ -28,8 +28,8 @@ public function setUp(): void 'array' => false, ]), new Document([ - '$id' => '$internalId', - 'key' => '$internalId', + '$id' => '$sequence', + 'key' => '$sequence', 'type' => Database::VAR_STRING, 'array' => false, ]),