From 23c3496a63945e4b89fcb8f738bce3a23d3b2a93 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 3 Feb 2026 22:30:02 +1300 Subject: [PATCH 1/3] Add missing model map --- .../Utopia/Response/Model/ColumnList.php | 6 +- src/Appwrite/Utopia/Response/Model/Table.php | 4 ++ .../TablesDB/DatabasesStringTypesTest.php | 69 +++++++++++++++++++ 3 files changed, 78 insertions(+), 1 deletion(-) diff --git a/src/Appwrite/Utopia/Response/Model/ColumnList.php b/src/Appwrite/Utopia/Response/Model/ColumnList.php index 4e76645d1b..e99223cd17 100644 --- a/src/Appwrite/Utopia/Response/Model/ColumnList.php +++ b/src/Appwrite/Utopia/Response/Model/ColumnList.php @@ -30,7 +30,11 @@ class ColumnList extends Model Response::MODEL_COLUMN_POINT, Response::MODEL_COLUMN_LINE, Response::MODEL_COLUMN_POLYGON, - Response::MODEL_COLUMN_STRING // needs to be last, since its condition would dominate any other string attribute + Response::MODEL_COLUMN_VARCHAR, + Response::MODEL_COLUMN_TEXT, + Response::MODEL_COLUMN_MEDIUMTEXT, + Response::MODEL_COLUMN_LONGTEXT, + Response::MODEL_COLUMN_STRING, // needs to be last, since its condition would dominate any other string attribute ], 'description' => 'List of columns.', 'default' => [], diff --git a/src/Appwrite/Utopia/Response/Model/Table.php b/src/Appwrite/Utopia/Response/Model/Table.php index 5018ab38db..c45ee85a69 100644 --- a/src/Appwrite/Utopia/Response/Model/Table.php +++ b/src/Appwrite/Utopia/Response/Model/Table.php @@ -74,6 +74,10 @@ class Table extends Model Response::MODEL_COLUMN_POINT, Response::MODEL_COLUMN_LINE, Response::MODEL_COLUMN_POLYGON, + Response::MODEL_COLUMN_VARCHAR, + Response::MODEL_COLUMN_TEXT, + Response::MODEL_COLUMN_MEDIUMTEXT, + Response::MODEL_COLUMN_LONGTEXT, Response::MODEL_COLUMN_STRING, // needs to be last, since its condition would dominate any other string attribute ], 'description' => 'Table columns.', diff --git a/tests/e2e/Services/Databases/TablesDB/DatabasesStringTypesTest.php b/tests/e2e/Services/Databases/TablesDB/DatabasesStringTypesTest.php index b10b8d42b7..94946a7967 100644 --- a/tests/e2e/Services/Databases/TablesDB/DatabasesStringTypesTest.php +++ b/tests/e2e/Services/Databases/TablesDB/DatabasesStringTypesTest.php @@ -760,6 +760,75 @@ class DatabasesStringTypesTest extends Scope /** * @depends testGetLongtextColumn */ + public function testGetTableWithStringTypeColumns(array $data): array + { + $databaseId = $data['databaseId']; + $tableId = $data['tableId']; + + // Test SUCCESS: Get full table - verifies Table model serializes all string column types + $table = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId, [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]); + + $this->assertEquals(200, $table['headers']['status-code']); + $this->assertEquals($tableId, $table['body']['$id']); + $this->assertIsArray($table['body']['columns']); + + // Extract column types from the response + $columnTypes = array_map(fn($col) => $col['type'], $table['body']['columns']); + + // Verify all new string types are present and properly serialized + $this->assertContains('varchar', $columnTypes, 'Table response should contain varchar columns'); + $this->assertContains('text', $columnTypes, 'Table response should contain text columns'); + $this->assertContains('mediumtext', $columnTypes, 'Table response should contain mediumtext columns'); + $this->assertContains('longtext', $columnTypes, 'Table response should contain longtext columns'); + + // Verify column keys are present + $columnKeys = array_map(fn($col) => $col['key'], $table['body']['columns']); + $this->assertContains('varchar_field', $columnKeys); + $this->assertContains('text_field', $columnKeys); + $this->assertContains('mediumtext_field', $columnKeys); + $this->assertContains('longtext_field', $columnKeys); + + return $data; + } + + /** + * @depends testGetTableWithStringTypeColumns + */ + public function testListColumnsWithStringTypes(array $data): array + { + $databaseId = $data['databaseId']; + $tableId = $data['tableId']; + + // Test SUCCESS: List all columns - verifies ColumnList model serializes all string column types + $columns = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]); + + $this->assertEquals(200, $columns['headers']['status-code']); + $this->assertIsArray($columns['body']['columns']); + $this->assertGreaterThan(0, $columns['body']['total']); + + // Extract column types from the response + $columnTypes = array_map(fn($col) => $col['type'], $columns['body']['columns']); + + // Verify all new string types are present and properly serialized + $this->assertContains('varchar', $columnTypes, 'Column list should contain varchar columns'); + $this->assertContains('text', $columnTypes, 'Column list should contain text columns'); + $this->assertContains('mediumtext', $columnTypes, 'Column list should contain mediumtext columns'); + $this->assertContains('longtext', $columnTypes, 'Column list should contain longtext columns'); + + return $data; + } + + /** + * @depends testListColumnsWithStringTypes + */ public function testDeleteStringTypeColumns(array $data): void { $databaseId = $data['databaseId']; From 413a91bd0a06fb4f08f2105c08b7773e23409805 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 3 Feb 2026 22:33:51 +1300 Subject: [PATCH 2/3] Lint --- .../Databases/TablesDB/DatabasesStringTypesTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/e2e/Services/Databases/TablesDB/DatabasesStringTypesTest.php b/tests/e2e/Services/Databases/TablesDB/DatabasesStringTypesTest.php index 94946a7967..d38e03ec89 100644 --- a/tests/e2e/Services/Databases/TablesDB/DatabasesStringTypesTest.php +++ b/tests/e2e/Services/Databases/TablesDB/DatabasesStringTypesTest.php @@ -777,7 +777,7 @@ class DatabasesStringTypesTest extends Scope $this->assertIsArray($table['body']['columns']); // Extract column types from the response - $columnTypes = array_map(fn($col) => $col['type'], $table['body']['columns']); + $columnTypes = array_map(fn ($col) => $col['type'], $table['body']['columns']); // Verify all new string types are present and properly serialized $this->assertContains('varchar', $columnTypes, 'Table response should contain varchar columns'); @@ -786,7 +786,7 @@ class DatabasesStringTypesTest extends Scope $this->assertContains('longtext', $columnTypes, 'Table response should contain longtext columns'); // Verify column keys are present - $columnKeys = array_map(fn($col) => $col['key'], $table['body']['columns']); + $columnKeys = array_map(fn ($col) => $col['key'], $table['body']['columns']); $this->assertContains('varchar_field', $columnKeys); $this->assertContains('text_field', $columnKeys); $this->assertContains('mediumtext_field', $columnKeys); @@ -815,7 +815,7 @@ class DatabasesStringTypesTest extends Scope $this->assertGreaterThan(0, $columns['body']['total']); // Extract column types from the response - $columnTypes = array_map(fn($col) => $col['type'], $columns['body']['columns']); + $columnTypes = array_map(fn ($col) => $col['type'], $columns['body']['columns']); // Verify all new string types are present and properly serialized $this->assertContains('varchar', $columnTypes, 'Column list should contain varchar columns'); From d2eb3f66847589cef1f49979321ed8501deb73da Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 3 Feb 2026 23:34:13 +1300 Subject: [PATCH 3/3] Update database --- composer.lock | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/composer.lock b/composer.lock index 10e68b7f63..1cbaf19d00 100644 --- a/composer.lock +++ b/composer.lock @@ -283,16 +283,16 @@ }, { "name": "brick/math", - "version": "0.14.3", + "version": "0.14.4", "source": { "type": "git", "url": "https://github.com/brick/math.git", - "reference": "6af96b11de3f7d99730c118c200418c48274edb4" + "reference": "a8b53e6cc4d3a336543f042a4dfa0e3f2f2356a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/brick/math/zipball/6af96b11de3f7d99730c118c200418c48274edb4", - "reference": "6af96b11de3f7d99730c118c200418c48274edb4", + "url": "https://api.github.com/repos/brick/math/zipball/a8b53e6cc4d3a336543f042a4dfa0e3f2f2356a4", + "reference": "a8b53e6cc4d3a336543f042a4dfa0e3f2f2356a4", "shasum": "" }, "require": { @@ -331,7 +331,7 @@ ], "support": { "issues": "https://github.com/brick/math/issues", - "source": "https://github.com/brick/math/tree/0.14.3" + "source": "https://github.com/brick/math/tree/0.14.4" }, "funding": [ { @@ -339,7 +339,7 @@ "type": "github" } ], - "time": "2026-02-01T15:18:05+00:00" + "time": "2026-02-02T16:57:31+00:00" }, { "name": "chillerlan/php-qrcode", @@ -3961,16 +3961,16 @@ }, { "name": "utopia-php/database", - "version": "5.0.0", + "version": "5.0.1", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "221794bd7de027f9177cd325209e8162ca2520cb" + "reference": "2783f07e74ddd86dda6e711d79212dd34158540d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/221794bd7de027f9177cd325209e8162ca2520cb", - "reference": "221794bd7de027f9177cd325209e8162ca2520cb", + "url": "https://api.github.com/repos/utopia-php/database/zipball/2783f07e74ddd86dda6e711d79212dd34158540d", + "reference": "2783f07e74ddd86dda6e711d79212dd34158540d", "shasum": "" }, "require": { @@ -4013,9 +4013,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/5.0.0" + "source": "https://github.com/utopia-php/database/tree/5.0.1" }, - "time": "2026-01-30T06:17:53+00:00" + "time": "2026-02-03T10:31:12+00:00" }, { "name": "utopia-php/detector", @@ -5546,16 +5546,16 @@ "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "1.8.22", + "version": "1.8.23", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "2888fa2abd820dca24f3d967ba54d498999e3caf" + "reference": "b80b8210b4940cfcfad970c8c07ccf1eee74c267" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/2888fa2abd820dca24f3d967ba54d498999e3caf", - "reference": "2888fa2abd820dca24f3d967ba54d498999e3caf", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/b80b8210b4940cfcfad970c8c07ccf1eee74c267", + "reference": "b80b8210b4940cfcfad970c8c07ccf1eee74c267", "shasum": "" }, "require": { @@ -5591,9 +5591,9 @@ "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", "support": { "issues": "https://github.com/appwrite/sdk-generator/issues", - "source": "https://github.com/appwrite/sdk-generator/tree/1.8.22" + "source": "https://github.com/appwrite/sdk-generator/tree/1.8.23" }, - "time": "2026-02-02T13:02:47+00:00" + "time": "2026-02-03T09:20:19+00:00" }, { "name": "doctrine/annotations", @@ -9052,7 +9052,7 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, "platform": { @@ -9076,5 +9076,5 @@ "platform-overrides": { "php": "8.3" }, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.9.0" }