diff --git a/app/init.php b/app/init.php index a0e71f041b..ef7742956f 100644 --- a/app/init.php +++ b/app/init.php @@ -118,7 +118,7 @@ const APP_USER_ACCESS = 24 * 60 * 60; // 24 hours const APP_PROJECT_ACCESS = 24 * 60 * 60; // 24 hours const APP_CACHE_UPDATE = 24 * 60 * 60; // 24 hours const APP_CACHE_BUSTER = 4314; -const APP_VERSION_STABLE = '1.5.7'; +const APP_VERSION_STABLE = '1.6.0'; const APP_DATABASE_ATTRIBUTE_EMAIL = 'email'; const APP_DATABASE_ATTRIBUTE_ENUM = 'enum'; const APP_DATABASE_ATTRIBUTE_IP = 'ip'; diff --git a/app/views/install/compose.phtml b/app/views/install/compose.phtml index a8de452b85..70c6fbdebd 100644 --- a/app/views/install/compose.phtml +++ b/app/views/install/compose.phtml @@ -166,7 +166,7 @@ $image = $this->getParam('image', ''); appwrite-console: <<: *x-logging container_name: appwrite-console - image: /console:appwrite/console:5.0.0-rc.5 + image: /console:appwrite/console:5.0.0-rc.11 restart: unless-stopped networks: - appwrite diff --git a/docker-compose.yml b/docker-compose.yml index fc8581c80a..d28586bf7b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -195,7 +195,7 @@ services: appwrite-console: <<: *x-logging container_name: appwrite-console - image: appwrite/console:5.0.0-rc.5 + image: appwrite/console:5.0.0-rc.11 restart: unless-stopped networks: - appwrite diff --git a/src/Appwrite/Migration/Migration.php b/src/Appwrite/Migration/Migration.php index e3a2021c1a..597943f842 100644 --- a/src/Appwrite/Migration/Migration.php +++ b/src/Appwrite/Migration/Migration.php @@ -86,6 +86,7 @@ abstract class Migration '1.5.5' => 'V20', '1.5.6' => 'V20', '1.5.7' => 'V20', + '1.6.0' => 'V21', ]; /** diff --git a/src/Appwrite/Migration/Version/V21.php b/src/Appwrite/Migration/Version/V21.php new file mode 100644 index 0000000000..75d083d87d --- /dev/null +++ b/src/Appwrite/Migration/Version/V21.php @@ -0,0 +1,72 @@ + null, + fn () => [] + ); + } + + Console::log('Migrating Project: ' . $this->project->getAttribute('name') . ' (' . $this->project->getId() . ')'); + $this->projectDB->setNamespace("_{$this->project->getInternalId()}"); + + Console::info('Migrating Collections'); + $this->migrateCollections(); + } + + /** + * Migrate Collections. + * + * @return void + * @throws Exception|Throwable + */ + private function migrateCollections(): void + { + $internalProjectId = $this->project->getInternalId(); + $collectionType = match ($internalProjectId) { + 'console' => 'console', + default => 'projects', + }; + + $collections = $this->collections[$collectionType]; + foreach ($collections as $collection) { + $id = $collection['$id']; + + Console::log("Migrating Collection \"{$id}\""); + + $this->projectDB->setNamespace("_$internalProjectId"); + + switch ($id) { + case 'projects': + + // Create accessedAt attribute + try { + $this->createAttributeFromCollection($this->projectDB, $id, 'accessedAt'); + } catch (Throwable $th) { + Console::warning("'accessedAt' from {$id}: {$th->getMessage()}"); + } + + break; + } + } + } +}