From c821282228dd6bd6b39241296d77d4053a8876d0 Mon Sep 17 00:00:00 2001 From: fogelito Date: Tue, 1 Aug 2023 12:46:09 +0300 Subject: [PATCH 1/3] composer.lock --- composer.lock | 76 +++++++++++++++++++++++++-------------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/composer.lock b/composer.lock index 4fae7f5619..2f2adcea38 100644 --- a/composer.lock +++ b/composer.lock @@ -2964,16 +2964,16 @@ }, { "name": "webonyx/graphql-php", - "version": "v14.11.9", + "version": "v14.11.10", "source": { "type": "git", "url": "https://github.com/webonyx/graphql-php.git", - "reference": "ff91c9f3cf241db702e30b2c42bcc0920e70ac70" + "reference": "d9c2fdebc6aa01d831bc2969da00e8588cffef19" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webonyx/graphql-php/zipball/ff91c9f3cf241db702e30b2c42bcc0920e70ac70", - "reference": "ff91c9f3cf241db702e30b2c42bcc0920e70ac70", + "url": "https://api.github.com/repos/webonyx/graphql-php/zipball/d9c2fdebc6aa01d831bc2969da00e8588cffef19", + "reference": "d9c2fdebc6aa01d831bc2969da00e8588cffef19", "shasum": "" }, "require": { @@ -2993,8 +2993,7 @@ "phpunit/phpunit": "^7.2 || ^8.5", "psr/http-message": "^1.0", "react/promise": "2.*", - "simpod/php-coveralls-mirror": "^3.0", - "squizlabs/php_codesniffer": "3.5.4" + "simpod/php-coveralls-mirror": "^3.0" }, "suggest": { "psr/http-message": "To use standard GraphQL server", @@ -3018,7 +3017,7 @@ ], "support": { "issues": "https://github.com/webonyx/graphql-php/issues", - "source": "https://github.com/webonyx/graphql-php/tree/v14.11.9" + "source": "https://github.com/webonyx/graphql-php/tree/v14.11.10" }, "funding": [ { @@ -3026,22 +3025,22 @@ "type": "open_collective" } ], - "time": "2023-01-06T12:12:50+00:00" + "time": "2023-07-05T14:23:37+00:00" } ], "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "0.33.1", + "version": "0.33.7", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "551cdae31a68b19874f10ca321b1d08cfa06a13f" + "reference": "9f5db4a637b23879ceacea9ed2d33b0486771ffc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/551cdae31a68b19874f10ca321b1d08cfa06a13f", - "reference": "551cdae31a68b19874f10ca321b1d08cfa06a13f", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/9f5db4a637b23879ceacea9ed2d33b0486771ffc", + "reference": "9f5db4a637b23879ceacea9ed2d33b0486771ffc", "shasum": "" }, "require": { @@ -3077,9 +3076,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.33.1" + "source": "https://github.com/appwrite/sdk-generator/tree/0.33.7" }, - "time": "2023-05-16T04:37:34+00:00" + "time": "2023-07-12T12:15:43+00:00" }, { "name": "doctrine/deprecations", @@ -3383,16 +3382,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.15.5", + "version": "v4.16.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "11e2663a5bc9db5d714eedb4277ee300403b4a9e" + "reference": "19526a33fb561ef417e822e85f08a00db4059c17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/11e2663a5bc9db5d714eedb4277ee300403b4a9e", - "reference": "11e2663a5bc9db5d714eedb4277ee300403b4a9e", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/19526a33fb561ef417e822e85f08a00db4059c17", + "reference": "19526a33fb561ef417e822e85f08a00db4059c17", "shasum": "" }, "require": { @@ -3433,9 +3432,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.5" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.16.0" }, - "time": "2023-05-19T20:20:00+00:00" + "time": "2023-06-25T14:52:30+00:00" }, { "name": "phar-io/manifest", @@ -3786,16 +3785,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.22.0", + "version": "1.23.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "ec58baf7b3c7f1c81b3b00617c953249fb8cf30c" + "reference": "a2b24135c35852b348894320d47b3902a94bc494" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/ec58baf7b3c7f1c81b3b00617c953249fb8cf30c", - "reference": "ec58baf7b3c7f1c81b3b00617c953249fb8cf30c", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/a2b24135c35852b348894320d47b3902a94bc494", + "reference": "a2b24135c35852b348894320d47b3902a94bc494", "shasum": "" }, "require": { @@ -3827,22 +3826,22 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.22.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.23.0" }, - "time": "2023-06-01T12:35:21+00:00" + "time": "2023-07-23T22:17:56+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "9.2.26", + "version": "9.2.27", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1" + "reference": "b0a88255cb70d52653d80c890bd7f38740ea50d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", - "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/b0a88255cb70d52653d80c890bd7f38740ea50d1", + "reference": "b0a88255cb70d52653d80c890bd7f38740ea50d1", "shasum": "" }, "require": { @@ -3898,7 +3897,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.26" + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.27" }, "funding": [ { @@ -3906,7 +3906,7 @@ "type": "github" } ], - "time": "2023-03-06T12:58:08+00:00" + "time": "2023-07-26T13:44:30+00:00" }, { "name": "phpunit/php-file-iterator", @@ -5581,16 +5581,16 @@ }, { "name": "twig/twig", - "version": "v3.6.1", + "version": "v3.7.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "7e7d5839d4bec168dfeef0ac66d5c5a2edbabffd" + "reference": "5cf942bbab3df42afa918caeba947f1b690af64b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/7e7d5839d4bec168dfeef0ac66d5c5a2edbabffd", - "reference": "7e7d5839d4bec168dfeef0ac66d5c5a2edbabffd", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/5cf942bbab3df42afa918caeba947f1b690af64b", + "reference": "5cf942bbab3df42afa918caeba947f1b690af64b", "shasum": "" }, "require": { @@ -5636,7 +5636,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.6.1" + "source": "https://github.com/twigphp/Twig/tree/v3.7.0" }, "funding": [ { @@ -5648,7 +5648,7 @@ "type": "tidelift" } ], - "time": "2023-06-08T12:52:13+00:00" + "time": "2023-07-26T07:16:09+00:00" } ], "aliases": [], From aaa2f18bf93ad8a94f3b6f1d98600d77b91d7e05 Mon Sep 17 00:00:00 2001 From: fogelito Date: Tue, 1 Aug 2023 13:23:39 +0300 Subject: [PATCH 2/3] uid varchar --- composer.lock | 2 +- src/Appwrite/Migration/Version/V19.php | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/composer.lock b/composer.lock index b01599337a..24d9f2ca0c 100644 --- a/composer.lock +++ b/composer.lock @@ -5677,5 +5677,5 @@ "platform-overrides": { "php": "8.0" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.2.0" } diff --git a/src/Appwrite/Migration/Version/V19.php b/src/Appwrite/Migration/Version/V19.php index 75cd472ebb..c31b4fa9e4 100644 --- a/src/Appwrite/Migration/Version/V19.php +++ b/src/Appwrite/Migration/Version/V19.php @@ -29,6 +29,7 @@ class V19 extends Migration $this->projectDB->setNamespace("_{$this->project->getInternalId()}"); $this->alterPermissionIndex('_metadata'); + $this->alterUidType('_metadata'); Console::info('Migrating Databases'); $this->migrateDatabases(); @@ -57,11 +58,13 @@ class V19 extends Migration $databaseTable = "database_{$database->getInternalId()}"; $this->alterPermissionIndex($databaseTable); + $this->alterUidType($databaseTable); foreach ($this->documentsIterator($databaseTable) as $collection) { $collectionTable = "{$databaseTable}_collection_{$collection->getInternalId()}"; Console::log("Migrating Collections of {$collectionTable} {$collection->getId()} ({$collection->getAttribute('name')})"); $this->alterPermissionIndex($collectionTable); + $this->alterUidType($collectionTable); } } } @@ -98,6 +101,7 @@ class V19 extends Migration } if (!in_array($id, ['files', 'collections'])) { $this->alterPermissionIndex($id); + $this->alterUidType($id); } usleep(50000); @@ -131,7 +135,7 @@ class V19 extends Migration protected function alterPermissionIndex($collectionName): void { try { - $table = "`{$this->projectDB->getDefaultDatabase()}`.`_{$this->project->getInternalId()}_{$collectionName}_perms"; + $table = "`{$this->projectDB->getDefaultDatabase()}`.`_{$this->project->getInternalId()}_{$collectionName}_perms`"; $this->pdo->prepare(" ALTER TABLE {$table} DROP INDEX `_permission`, @@ -142,6 +146,20 @@ class V19 extends Migration } } + protected function alterUidType($collectionName): void + { + try { + $table = "`{$this->projectDB->getDefaultDatabase()}`.`_{$this->project->getInternalId()}_{$collectionName}`"; + + $this->pdo->prepare(" + ALTER TABLE {$table} + CHANGE COLUMN `_uid` `_uid` VARCHAR(255) NOT NULL ; + ")->execute(); + } catch (\Throwable $th) { + Console::warning($th->getMessage()); + } + } + /** * Migrating all Bucket tables. * @@ -155,6 +173,7 @@ class V19 extends Migration $id = "bucket_{$bucket->getInternalId()}"; Console::log("Migrating Bucket {$id} {$bucket->getId()} ({$bucket->getAttribute('name')})"); $this->alterPermissionIndex($id); + $this->alterUidType($id); } } } From e62052546037520105f4ebd21ed11b0befe211e3 Mon Sep 17 00:00:00 2001 From: fogelito Date: Tue, 1 Aug 2023 13:24:28 +0300 Subject: [PATCH 3/3] Extra line --- src/Appwrite/Migration/Version/V19.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Appwrite/Migration/Version/V19.php b/src/Appwrite/Migration/Version/V19.php index c31b4fa9e4..39522aff0b 100644 --- a/src/Appwrite/Migration/Version/V19.php +++ b/src/Appwrite/Migration/Version/V19.php @@ -150,7 +150,6 @@ class V19 extends Migration { try { $table = "`{$this->projectDB->getDefaultDatabase()}`.`_{$this->project->getInternalId()}_{$collectionName}`"; - $this->pdo->prepare(" ALTER TABLE {$table} CHANGE COLUMN `_uid` `_uid` VARCHAR(255) NOT NULL ;