From a28312be460eda83e4ef402f25466201dabc4cbc Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 4 Jan 2024 02:23:08 +0000 Subject: [PATCH] refactor collections --- app/config/collections.php | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/app/config/collections.php b/app/config/collections.php index a0b6fb80b8..7c573bc786 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -3195,13 +3195,13 @@ $projectCollections = array_merge([ ], ], - 'fileTokens' => [ + 'resource_tokens' => [ '$collection' => ID::custom(Database::METADATA), - '$id' => ID::custom('fileTokens'), - 'name' => 'File Tokens', + '$id' => ID::custom('resource_tokens'), + 'name' => 'Resource Tokens', 'attributes' => [ [ - '$id' => ID::custom('fileId'), + '$id' => ID::custom('resourceId'), 'type' => Database::VAR_STRING, 'format' => '', 'size' => Database::LENGTH_KEY, @@ -3212,7 +3212,7 @@ $projectCollections = array_merge([ 'filters' => [], ], [ - '$id' => ID::custom('fileInternalId'), + '$id' => ID::custom('resourceInternalId'), 'type' => Database::VAR_STRING, 'format' => '', 'size' => Database::LENGTH_KEY, @@ -3223,21 +3223,10 @@ $projectCollections = array_merge([ 'filters' => [], ], [ - '$id' => ID::custom('bucketId'), + '$id' => ID::custom('resourceType'), 'type' => Database::VAR_STRING, 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('bucketInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, + 'size' => 100, 'signed' => true, 'required' => true, 'default' => null, @@ -3268,13 +3257,6 @@ $projectCollections = array_merge([ ] ], 'indexes' => [ - [ - '$id' => '_key_file_id_bucket_id', - 'type' => Database::INDEX_KEY, - 'attributes' => ['bucketInternalId', 'fileInternalId'], - 'lengths' => [Database::LENGTH_KEY, Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC, Database::ORDER_ASC], - ], [ '$id' => '_key_expiry_date', 'type' => Database::INDEX_KEY,