From eae455da01e96c2d6bbccbb61a569585d072b975 Mon Sep 17 00:00:00 2001 From: Hemachandar Date: Tue, 30 Dec 2025 16:16:18 +0530 Subject: [PATCH] add subqueries --- app/config/collections/platform.php | 30 ++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/app/config/collections/platform.php b/app/config/collections/platform.php index 94d65f4af3..73d42881db 100644 --- a/app/config/collections/platform.php +++ b/app/config/collections/platform.php @@ -6,7 +6,7 @@ use Utopia\Database\Helpers\ID; $providers = Config::getParam('oAuthProviders', []); -return [ +$platformCollections = [ 'projects' => [ '$collection' => ID::custom(Database::METADATA), '$id' => ID::custom('projects'), @@ -1943,3 +1943,31 @@ return [ 'indexes' => [] ], ]; + +// Organization API keys subquery +$platformCollections['teams']['attributes'][] = [ + '$id' => ID::custom('keys'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['subQueryOrganizationKeys'], +]; + +// Account API keys subquery +$platformCollections['users']['attributes'][] = [ + '$id' => ID::custom('keys'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['subQueryAccountKeys'], +]; + +return $platformCollections; \ No newline at end of file