diff --git a/composer.lock b/composer.lock index c8b4ad7ee8..0e535c7c0c 100644 --- a/composer.lock +++ b/composer.lock @@ -4042,16 +4042,16 @@ }, { "name": "utopia-php/migration", - "version": "0.14.0", + "version": "0.14.1", "source": { "type": "git", "url": "https://github.com/utopia-php/migration.git", - "reference": "f9a7e87413b82975dbd87b7850aec2543aeac7ee" + "reference": "34bb7c487b00cefa35fddcff0621e704a23f4ebf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/migration/zipball/f9a7e87413b82975dbd87b7850aec2543aeac7ee", - "reference": "f9a7e87413b82975dbd87b7850aec2543aeac7ee", + "url": "https://api.github.com/repos/utopia-php/migration/zipball/34bb7c487b00cefa35fddcff0621e704a23f4ebf", + "reference": "34bb7c487b00cefa35fddcff0621e704a23f4ebf", "shasum": "" }, "require": { @@ -4092,9 +4092,9 @@ ], "support": { "issues": "https://github.com/utopia-php/migration/issues", - "source": "https://github.com/utopia-php/migration/tree/0.14.0" + "source": "https://github.com/utopia-php/migration/tree/0.14.1" }, - "time": "2025-08-05T12:33:09+00:00" + "time": "2025-08-06T11:46:44+00:00" }, { "name": "utopia-php/orchestration", @@ -4859,16 +4859,16 @@ "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "0.41.28", + "version": "0.41.29", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "8eace11070264c62c8da3c69498fb8dc98fcfaf7" + "reference": "4af563f3b0879747efc8434eb8ed8bf97e75039f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/8eace11070264c62c8da3c69498fb8dc98fcfaf7", - "reference": "8eace11070264c62c8da3c69498fb8dc98fcfaf7", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/4af563f3b0879747efc8434eb8ed8bf97e75039f", + "reference": "4af563f3b0879747efc8434eb8ed8bf97e75039f", "shasum": "" }, "require": { @@ -4904,9 +4904,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/0.41.28" + "source": "https://github.com/appwrite/sdk-generator/tree/0.41.29" }, - "time": "2025-08-01T11:06:30+00:00" + "time": "2025-08-04T04:34:45+00:00" }, { "name": "doctrine/annotations", diff --git a/src/Appwrite/Migration/Version/V23.php b/src/Appwrite/Migration/Version/V23.php index 88f6d0451b..d5caf2ab3c 100644 --- a/src/Appwrite/Migration/Version/V23.php +++ b/src/Appwrite/Migration/Version/V23.php @@ -46,7 +46,7 @@ class V23 extends Migration // since required + default can't be used together // so first creating the attribute then bulk updating the attribute $this->createAttributeFromCollection($this->dbForProject, 'databases', 'type'); - $this->dbForProject->updateDocuments('databases', new Document(['type' => 'sql'])); + $this->dbForProject->updateDocuments('databases', new Document(['type' => 'legacy'])); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Create.php index e5256deb3b..b2f89f92f2 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Create.php @@ -81,7 +81,7 @@ class Create extends Action ->param('databaseId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Database name. Max length: 128 chars.') ->param('enabled', true, new Boolean(), 'Is the database enabled? When set to \'disabled\', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.', true) - ->param('type', 'sql', new WhiteList(['sql','nosql']), 'Database type.', true) + ->param('type', 'grids', new WhiteList(['grids','legacy']), 'Database type.', true) ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') diff --git a/src/Appwrite/Utopia/Response/Model/Database.php b/src/Appwrite/Utopia/Response/Model/Database.php index a9ce20da74..b38f828047 100644 --- a/src/Appwrite/Utopia/Response/Model/Database.php +++ b/src/Appwrite/Utopia/Response/Model/Database.php @@ -43,8 +43,8 @@ class Database extends Model ->addRule('type', [ 'type' => self::TYPE_STRING, 'description' => 'Database type.', - 'default' => 'sql', - 'example' => 'sql', + 'default' => 'grids', + 'example' => 'grids', ]) ; } diff --git a/tests/e2e/Services/Databases/Grids/DatabasesBase.php b/tests/e2e/Services/Databases/Grids/DatabasesBase.php index 2e0f7bc6ea..1ec957a50e 100644 --- a/tests/e2e/Services/Databases/Grids/DatabasesBase.php +++ b/tests/e2e/Services/Databases/Grids/DatabasesBase.php @@ -32,7 +32,7 @@ trait DatabasesBase $this->assertNotEmpty($database['body']['$id']); $this->assertEquals(201, $database['headers']['status-code']); $this->assertEquals('Test Database', $database['body']['name']); - $this->assertEquals('sql', $database['body']['type']); + $this->assertEquals('grids', $database['body']['type']); // testing to create a database with type $database2 = $this->client->call(Client::METHOD_POST, '/databases', [ @@ -53,12 +53,12 @@ trait DatabasesBase ], [ 'databaseId' => ID::unique(), 'name' => 'Test Database with type', - 'type' => 'nosql' + 'type' => 'legacy' ]); $this->assertNotEmpty($database2['body']['$id']); $this->assertEquals(201, $database2['headers']['status-code']); $this->assertEquals('Test Database with type', $database2['body']['name']); - $this->assertEquals('nosql', $database2['body']['type']); + $this->assertEquals('legacy', $database2['body']['type']); // cleanup(for database2) $databaseId = $database2['body']['$id']; diff --git a/tests/e2e/Services/Databases/Legacy/DatabasesBase.php b/tests/e2e/Services/Databases/Legacy/DatabasesBase.php index 449d3621c5..3fbb589fb0 100644 --- a/tests/e2e/Services/Databases/Legacy/DatabasesBase.php +++ b/tests/e2e/Services/Databases/Legacy/DatabasesBase.php @@ -32,7 +32,7 @@ trait DatabasesBase $this->assertNotEmpty($database['body']['$id']); $this->assertEquals(201, $database['headers']['status-code']); $this->assertEquals('Test Database', $database['body']['name']); - $this->assertEquals('sql', $database['body']['type']); + $this->assertEquals('grids', $database['body']['type']); // testing to create a database with type $database2 = $this->client->call(Client::METHOD_POST, '/databases', [ @@ -53,12 +53,12 @@ trait DatabasesBase ], [ 'databaseId' => ID::unique(), 'name' => 'Test Database with type', - 'type' => 'nosql' + 'type' => 'legacy' ]); $this->assertNotEmpty($database2['body']['$id']); $this->assertEquals(201, $database2['headers']['status-code']); $this->assertEquals('Test Database with type', $database2['body']['name']); - $this->assertEquals('nosql', $database2['body']['type']); + $this->assertEquals('legacy', $database2['body']['type']); // cleanup(for database2) $databaseId = $database2['body']['$id'];