From f7497784d330643c062b4636e2b9a3aa0ef12e8d Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Sun, 1 Aug 2021 16:37:59 +0300 Subject: [PATCH] Backward compatibility --- src/Appwrite/Database/Database.php | 1 + src/Appwrite/Event/Event.php | 3 --- src/Appwrite/Migration/Version/V05.php | 6 +++--- tests/unit/Migration/MigrationV05Test.php | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Appwrite/Database/Database.php b/src/Appwrite/Database/Database.php index a27c4b4d71..e6cfa001d1 100644 --- a/src/Appwrite/Database/Database.php +++ b/src/Appwrite/Database/Database.php @@ -18,6 +18,7 @@ class Database const SYSTEM_COLLECTION_PROJECTS = 'projects'; const SYSTEM_COLLECTION_WEBHOOKS = 'webhooks'; const SYSTEM_COLLECTION_KEYS = 'keys'; + const SYSTEM_COLLECTION_TASKS = 'tasks'; const SYSTEM_COLLECTION_PLATFORMS = 'platforms'; const SYSTEM_COLLECTION_USAGES = 'usages'; // TODO add structure const SYSTEM_COLLECTION_DOMAINS = 'domains'; diff --git a/src/Appwrite/Event/Event.php b/src/Appwrite/Event/Event.php index caa87f52b2..a367e07900 100644 --- a/src/Appwrite/Event/Event.php +++ b/src/Appwrite/Event/Event.php @@ -28,12 +28,9 @@ class Event const WEBHOOK_QUEUE_NAME = 'v1-webhooks'; const WEBHOOK_CLASS_NAME = 'WebhooksV1'; - const TASK_CLASS_NAME = 'TasksV1'; - const CERTIFICATES_QUEUE_NAME = 'v1-certificates'; const CERTIFICATES_CLASS_NAME = 'CertificatesV1'; - /** * @var string */ diff --git a/src/Appwrite/Migration/Version/V05.php b/src/Appwrite/Migration/Version/V05.php index 730433313f..bcabe6e0a1 100644 --- a/src/Appwrite/Migration/Version/V05.php +++ b/src/Appwrite/Migration/Version/V05.php @@ -68,9 +68,9 @@ class V05 extends Migration $document->setAttribute('security', $document->getAttribute('security') ? true : false); break; - // case Database::SYSTEM_COLLECTION_TASKS: - // $document->setAttribute('security', $document->getAttribute('security') ? true : false); - // break; + case Database::SYSTEM_COLLECTION_TASKS: + $document->setAttribute('security', $document->getAttribute('security') ? true : false); + break; case Database::SYSTEM_COLLECTION_USERS: foreach ($providers as $key => $provider) { diff --git a/tests/unit/Migration/MigrationV05Test.php b/tests/unit/Migration/MigrationV05Test.php index d1c900889f..09e28dd054 100644 --- a/tests/unit/Migration/MigrationV05Test.php +++ b/tests/unit/Migration/MigrationV05Test.php @@ -43,7 +43,7 @@ class MigrationV05Test extends MigrationTest $document = $this->fixDocument(new Document([ '$uid' => 'unique', - '$collection' => Database::SYSTEM_COLLECTION_WEBHOOKS + '$collection' => Database::SYSTEM_COLLECTION_TASKS ])); $this->assertEquals($document->getAttribute('$uid', null), null);