diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Columns/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/Columns/XList.php index cba6e2d077..e9800e71a0 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Columns/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Columns/XList.php @@ -118,7 +118,7 @@ class XList extends Action } $response->dynamic(new Document([ - 'attributes' => $columns, + 'columns' => $columns, 'total' => $total, ]), UtopiaResponse::MODEL_COLUMN_LIST); } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Usage/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Usage/Get.php index c4105effa0..c7ae2e4d81 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Usage/Get.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Usage/Get.php @@ -123,13 +123,13 @@ class Get extends Action $response->dynamic(new Document([ 'range' => $range, - 'collectionsTotal' => $usage[$metrics[0]]['total'], - 'documentsTotal' => $usage[$metrics[1]]['total'], + 'tablesTotal' => $usage[$metrics[0]]['total'], + 'rowsTotal' => $usage[$metrics[1]]['total'], 'storageTotal' => $usage[$metrics[2]]['total'], 'databaseReadsTotal' => $usage[$metrics[3]]['total'], 'databaseWritesTotal' => $usage[$metrics[4]]['total'], - 'collections' => $usage[$metrics[0]]['data'], - 'documents' => $usage[$metrics[1]]['data'], + 'tables' => $usage[$metrics[0]]['data'], + 'rows' => $usage[$metrics[1]]['data'], 'storage' => $usage[$metrics[2]]['data'], 'databaseReads' => $usage[$metrics[3]]['data'], 'databaseWrites' => $usage[$metrics[4]]['data'], diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Usage/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Usage/XList.php index 0078d54a4b..8737585e8c 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Usage/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Usage/XList.php @@ -116,14 +116,14 @@ class XList extends Action $response->dynamic(new Document([ 'range' => $range, 'databasesTotal' => $usage[$metrics[0]]['total'], - 'collectionsTotal' => $usage[$metrics[1]]['total'], - 'documentsTotal' => $usage[$metrics[2]]['total'], + 'tablesTotal' => $usage[$metrics[1]]['total'], + 'rowsTotal' => $usage[$metrics[2]]['total'], 'storageTotal' => $usage[$metrics[3]]['total'], 'databasesReadsTotal' => $usage[$metrics[4]]['total'], 'databasesWritesTotal' => $usage[$metrics[5]]['total'], 'databases' => $usage[$metrics[0]]['data'], - 'collections' => $usage[$metrics[1]]['data'], - 'documents' => $usage[$metrics[2]]['data'], + 'tables' => $usage[$metrics[1]]['data'], + 'rows' => $usage[$metrics[2]]['data'], 'storage' => $usage[$metrics[3]]['data'], 'databasesReads' => $usage[$metrics[4]]['data'], 'databasesWrites' => $usage[$metrics[5]]['data'], diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Rows/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Rows/Update.php index b7f3a4f6c4..c9ed71d569 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Rows/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Rows/Update.php @@ -150,17 +150,17 @@ class Update extends Action $operations = 0; - $setTable = (function (Document $collection, Document $document) use (&$setTable, $dbForProject, $database, &$operations) { + $setTable = (function (Document $table, Document $row) use (&$setTable, $dbForProject, $database, &$operations) { $operations++; $relationships = \array_filter( - $collection->getAttribute('attributes', []), + $table->getAttribute('attributes', []), fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP ); foreach ($relationships as $relationship) { - $related = $document->getAttribute($relationship->getAttribute('key')); + $related = $row->getAttribute($relationship->getAttribute('key')); if (empty($related)) { continue; @@ -212,9 +212,9 @@ class Update extends Action } if ($isList) { - $document->setAttribute($relationship->getAttribute('key'), \array_values($relations)); + $row->setAttribute($relationship->getAttribute('key'), \array_values($relations)); } else { - $document->setAttribute($relationship->getAttribute('key'), \reset($relations)); + $row->setAttribute($relationship->getAttribute('key'), \reset($relations)); } } }); diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Rows/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/Rows/XList.php index e93d72cad6..4396c2b112 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Rows/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Rows/XList.php @@ -217,7 +217,7 @@ class XList extends Action $response->dynamic(new Document([ 'total' => $total, - 'documents' => $rows, + 'rows' => $rows, ]), UtopiaResponse::MODEL_ROW_LIST); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Tables/Usage/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/Tables/Usage/Get.php index 3943c27618..b55fa84282 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Tables/Usage/Get.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Tables/Usage/Get.php @@ -124,8 +124,8 @@ class Get extends Action $response->dynamic(new Document([ 'range' => $range, - 'documentsTotal' => $usage[$metrics[0]]['total'], - 'documents' => $usage[$metrics[0]]['data'], + 'rows' => $usage[$metrics[0]]['data'], + 'rowsTotal' => $usage[$metrics[0]]['total'], ]), UtopiaResponse::MODEL_USAGE_COLLECTION); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Tables/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/Tables/XList.php index a5e6789eaa..86107cc533 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Tables/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Tables/XList.php @@ -110,7 +110,7 @@ class XList extends Action } $response->dynamic(new Document([ - 'collections' => $tables, + 'tables' => $tables, 'total' => $total, ]), UtopiaResponse::MODEL_TABLE_LIST); }