From 4c08097e92e1d0440daf6a61d6925f1a2d0ef965 Mon Sep 17 00:00:00 2001 From: kodumbeats Date: Sun, 8 Aug 2021 19:42:08 -0400 Subject: [PATCH] Use system for naming worker constants --- app/init.php | 14 +++++++------- app/workers/database.php | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/init.php b/app/init.php index 72b3dedc7..4ed09857f 100644 --- a/app/init.php +++ b/app/init.php @@ -76,18 +76,18 @@ const APP_SOCIAL_DISCORD = 'https://appwrite.io/discord'; const APP_SOCIAL_DISCORD_CHANNEL = '564160730845151244'; const APP_SOCIAL_DEV = 'https://dev.to/appwrite'; const APP_SOCIAL_STACKSHARE = 'https://stackshare.io/appwrite'; -// Creation Types -const CREATE_TYPE_ATTRIBUTE = 'newAttribute'; -const CREATE_TYPE_INDEX = 'newIndex'; -// Deletion Types -const DELETE_TYPE_ATTRIBUTE = 'attribute'; -const DELETE_TYPE_INDEX = 'index'; +// Database Worker Types +const DATABASE_TYPE_CREATE_ATTRIBUTE = 'createAttribute'; +const DATABASE_TYPE_CREATE_INDEX = 'createIndex'; +const DATABASE_TYPE_DELETE_ATTRIBUTE = 'deleteAttribute'; +const DATABASE_TYPE_DELETE_INDEX = 'deleteIndex'; +// Deletes Worker Types const DELETE_TYPE_DOCUMENT = 'document'; const DELETE_TYPE_EXECUTIONS = 'executions'; const DELETE_TYPE_AUDIT = 'audit'; const DELETE_TYPE_ABUSE = 'abuse'; const DELETE_TYPE_CERTIFICATES = 'certificates'; -// Mail Types +// Mail Worker Types const MAIL_TYPE_VERIFICATION = 'verification'; const MAIL_TYPE_RECOVERY = 'recovery'; const MAIL_TYPE_INVITATION = 'invitation'; diff --git a/app/workers/database.php b/app/workers/database.php index 42df89e1b..ca0351119 100644 --- a/app/workers/database.php +++ b/app/workers/database.php @@ -23,22 +23,22 @@ class DatabaseV1 extends Worker $type = $this->args['type'] ?? ''; switch (strval($type)) { - case CREATE_TYPE_ATTRIBUTE: + case DATABASE_TYPE_CREATE_ATTRIBUTE: $attribute = $this->args['document'] ?? ''; $attribute = new Document($attribute); $this->createAttribute($attribute, $projectId); break; - case DELETE_TYPE_ATTRIBUTE: + case DATABASE_TYPE_DELETE_ATTRIBUTE: $attribute = $this->args['document'] ?? ''; $attribute = new Document($attribute); $this->deleteAttribute($attribute, $projectId); break; - case CREATE_TYPE_INDEX: + case DATABASE_TYPE_CREATE_INDEX: $index = $this->args['document'] ?? ''; $index = new Document($index); $this->createIndex($index, $projectId); break; - case DELETE_TYPE_INDEX: + case DATABASE_TYPE_DELETE_INDEX: $index = $this->args['document'] ?? ''; $index = new Document($index); $this->deleteIndex($index, $projectId);