From be609f4ee2c84377fcab503e3dee8df0ea86f881 Mon Sep 17 00:00:00 2001 From: Aditya Oberai Date: Wed, 12 Apr 2023 09:55:36 +0000 Subject: [PATCH 1/6] Update Appwrite 1.3 blog link in Readme --- README-CN.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README-CN.md b/README-CN.md index f9e211c6b9..69b9f698ef 100644 --- a/README-CN.md +++ b/README-CN.md @@ -24,7 +24,7 @@ [English](README.md) | 简体中文 -[**我们发布了 Appwrite Console 2.0 版本,点击这里了解更多!**](https://medium.com/appwrite-io/announcing-console-2-0-2e0e96891cb0?source=friends_link&sk=7a82b4069778e3adc165dc026e960fe1) +[**宣布带有数据库关系的 Appwrite 1.3!了解最新消息!**](https://dev.to/appwrite/join-celebrations-appwrite-13-ships-relationships-57fc) Appwrite是一个基于Docker的端到端开发者平台,其容器化的微服务库可应用于网页端,移动端,以及后端。Appwrite 通过视觉化界面简化了从零开始编写 API 的繁琐过程,在保证软件安全的前提下为开发者创造了一个高效的开发环境。 diff --git a/README.md b/README.md index aa808d82c3..0ae7d0b542 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ English | [简体中文](README-CN.md) - +[**Announcing Appwrite 1.3 with Database Relationships! Learn what's new!**](https://dev.to/appwrite/join-celebrations-appwrite-13-ships-relationships-57fc) Appwrite is an end-to-end backend server for Web, Mobile, Native, or Backend apps packaged as a set of Docker microservices. Appwrite abstracts the complexity and repetitiveness required to build a modern backend API from scratch and allows you to build secure apps faster. From 3009168350b19153b45709d7c1a33d2d4487315f Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Wed, 12 Apr 2023 17:48:36 +0200 Subject: [PATCH 2/6] fix: migration for 1.3.x --- src/Appwrite/Migration/Version/V18.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Appwrite/Migration/Version/V18.php b/src/Appwrite/Migration/Version/V18.php index 2fedf4957e..eba19fa861 100644 --- a/src/Appwrite/Migration/Version/V18.php +++ b/src/Appwrite/Migration/Version/V18.php @@ -33,9 +33,7 @@ class V18 extends Migration $this->migrateCollections(); Console::info('Migrating Documents'); - $this->forEachDocument(function (Document $document) { - $this->migrateDocument($document); - }); + $this->forEachDocument([$this, 'fixDocument']); } /** @@ -131,7 +129,7 @@ class V18 extends Migration * @param Document $document * @return Document */ - private function migrateDocument(Document $document): Document + protected function fixDocument(Document $document): Document { switch ($document->getCollection()) { case 'projects': From 52d7dcf08260accaf1edaa413a70aca5a121bd17 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Wed, 12 Apr 2023 18:02:43 +0200 Subject: [PATCH 3/6] fix: update prefs endpoints to not fallback to stdClass --- app/controllers/api/account.php | 2 +- app/controllers/api/users.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 11d67232c7..dd5ac4a2da 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -1356,7 +1356,7 @@ App::get('/v1/account/prefs') ->inject('user') ->action(function (Response $response, Document $user) { - $prefs = $user->getAttribute('prefs', new \stdClass()); + $prefs = $user->getAttribute('prefs', []); $response->dynamic(new Document($prefs), Response::MODEL_PREFERENCES); }); diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index 7e7e342de9..ceed901a32 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -457,7 +457,7 @@ App::get('/v1/users/:userId/prefs') throw new Exception(Exception::USER_NOT_FOUND); } - $prefs = $user->getAttribute('prefs', new \stdClass()); + $prefs = $user->getAttribute('prefs', []); $response->dynamic(new Document($prefs), Response::MODEL_PREFERENCES); }); From 34d27fb4d0e74b31e334b0a8618ab70efd2a8858 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Wed, 12 Apr 2023 18:03:08 +0200 Subject: [PATCH 4/6] fix: prefs for teams --- app/controllers/api/teams.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index fbe7fd5398..338af70406 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -223,7 +223,7 @@ App::get('/v1/teams/:teamId/prefs') throw new Exception(Exception::TEAM_NOT_FOUND); } - $prefs = $team->getAttribute('prefs', new \stdClass()); + $prefs = $team->getAttribute('prefs', []); $response->dynamic(new Document($prefs), Response::MODEL_PREFERENCES); }); From d2b2d1813441f3d3c9a579d0a311f6f515a3ed21 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Wed, 12 Apr 2023 18:13:49 +0200 Subject: [PATCH 5/6] chore: prepare 1.3.1 release --- CHANGES.md | 5 +++++ README-CN.md | 6 +++--- README.md | 6 +++--- app/init.php | 4 ++-- src/Appwrite/Migration/Migration.php | 1 + 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 97c44bb03a..21501b1bd5 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,8 @@ +# Version 1.3.1 + +## Bugs +- Fixed Migration issue regarding 500 error [4906](https://github.com/appwrite/appwrite/pull/5356) + # Version 1.3.0 ## Features diff --git a/README-CN.md b/README-CN.md index f9e211c6b9..3c411ee826 100644 --- a/README-CN.md +++ b/README-CN.md @@ -67,7 +67,7 @@ docker run -it --rm \ --volume /var/run/docker.sock:/var/run/docker.sock \ --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \ --entrypoint="install" \ - appwrite/appwrite:1.3.0 + appwrite/appwrite:1.3.1 ``` ### Windows @@ -79,7 +79,7 @@ docker run -it --rm ^ --volume //var/run/docker.sock:/var/run/docker.sock ^ --volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^ --entrypoint="install" ^ - appwrite/appwrite:1.3.0 + appwrite/appwrite:1.3.1 ``` #### PowerShell @@ -89,7 +89,7 @@ docker run -it --rm ` --volume /var/run/docker.sock:/var/run/docker.sock ` --volume ${pwd}/appwrite:/usr/src/code/appwrite:rw ` --entrypoint="install" ` - appwrite/appwrite:1.3.0 + appwrite/appwrite:1.3.1 ``` 运行后,可以在浏览器上访问 http://localhost 找到 Appwrite 控制台。在非 Linux 的本机主机上完成安装后,服务器可能需要几分钟才能启动。 diff --git a/README.md b/README.md index aa808d82c3..bfb58aa60e 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ docker run -it --rm \ --volume /var/run/docker.sock:/var/run/docker.sock \ --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \ --entrypoint="install" \ - appwrite/appwrite:1.3.0 + appwrite/appwrite:1.3.1 ``` ### Windows @@ -88,7 +88,7 @@ docker run -it --rm ^ --volume //var/run/docker.sock:/var/run/docker.sock ^ --volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^ --entrypoint="install" ^ - appwrite/appwrite:1.3.0 + appwrite/appwrite:1.3.1 ``` #### PowerShell @@ -98,7 +98,7 @@ docker run -it --rm ` --volume /var/run/docker.sock:/var/run/docker.sock ` --volume ${pwd}/appwrite:/usr/src/code/appwrite:rw ` --entrypoint="install" ` - appwrite/appwrite:1.3.0 + appwrite/appwrite:1.3.1 ``` Once the Docker installation is complete, go to http://localhost to access the Appwrite console from your browser. Please note that on non-Linux native hosts, the server might take a few minutes to start after completing the installation. diff --git a/app/init.php b/app/init.php index aaa4229cb0..02fd9246f7 100644 --- a/app/init.php +++ b/app/init.php @@ -100,8 +100,8 @@ const APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT = 60; // Default maximum write rate pe const APP_LIMIT_LIST_DEFAULT = 25; // Default maximum number of items to return in list API calls const APP_KEY_ACCCESS = 24 * 60 * 60; // 24 hours const APP_CACHE_UPDATE = 24 * 60 * 60; // 24 hours -const APP_CACHE_BUSTER = 502; -const APP_VERSION_STABLE = '1.3.0'; +const APP_CACHE_BUSTER = 503; +const APP_VERSION_STABLE = '1.3.1'; const APP_DATABASE_ATTRIBUTE_EMAIL = 'email'; const APP_DATABASE_ATTRIBUTE_ENUM = 'enum'; const APP_DATABASE_ATTRIBUTE_IP = 'ip'; diff --git a/src/Appwrite/Migration/Migration.php b/src/Appwrite/Migration/Migration.php index 62c4dfba63..4a79ffafbf 100644 --- a/src/Appwrite/Migration/Migration.php +++ b/src/Appwrite/Migration/Migration.php @@ -53,6 +53,7 @@ abstract class Migration '1.2.0' => 'V17', '1.2.1' => 'V17', '1.3.0' => 'V18', + '1.3.1' => 'V18', ]; /** From 8872d9db177538254b459f441ab1cda23365900e Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Wed, 12 Apr 2023 18:23:09 +0200 Subject: [PATCH 6/6] feat: upgrade to console 2.3.3 --- .gitmodules | 2 +- app/console | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 52083ed250..a4bea14d38 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule "app/console"] path = app/console url = https://github.com/appwrite/console - branch = 2.3.2 + branch = 2.3.3 diff --git a/app/console b/app/console index cfb6a45f27..ac4181aea4 160000 --- a/app/console +++ b/app/console @@ -1 +1 @@ -Subproject commit cfb6a45f27c13be8b9785c9a67c081ccb9cc9d31 +Subproject commit ac4181aea403d888e63cb527c700e80013c68ea8