diff --git a/app/controllers/api/database.php b/app/controllers/api/database.php index cc5e83a27d..6b1842710f 100644 --- a/app/controllers/api/database.php +++ b/app/controllers/api/database.php @@ -1273,6 +1273,7 @@ App::post('/v1/database/collections/:collectionId/indexes') // Convert Document[] to array of attribute metadata $oldAttributes = \array_map(fn ($a) => $a->getArrayCopy(), $collection->getAttribute('attributes')); + $oldAttributes[] = [ 'key' => '$id', 'type' => 'string', @@ -1282,7 +1283,28 @@ App::post('/v1/database/collections/:collectionId/indexes') 'default' => null, 'size' => 36 ]; - // TODO: Allow $createdAt, $updatedAt + + $oldAttributes[] = [ + 'key' => '$createdAt', + 'type' => 'integer', + 'status' => 'available', + 'signed' => false, + 'required' => false, + 'array' => false, + 'default' => null, + 'size' => 0 + ]; + + $oldAttributes[] = [ + 'key' => '$updatedAt', + 'type' => 'integer', + 'status' => 'available', + 'signed' => false, + 'required' => false, + 'array' => false, + 'default' => null, + 'size' => 0 + ]; // lengths hidden by default $lengths = []; diff --git a/app/views/console/database/collection.phtml b/app/views/console/database/collection.phtml index 1de82ce204..c20c8b19d3 100644 --- a/app/views/console/database/collection.phtml +++ b/app/views/console/database/collection.phtml @@ -1127,7 +1127,8 @@ $logs = $this->getParam('logs', null);
diff --git a/composer.lock b/composer.lock index f1cc057aa0..d2302f8599 100644 --- a/composer.lock +++ b/composer.lock @@ -5346,18 +5346,9 @@ "time": "2022-05-17T05:48:52+00:00" } ], - "aliases": [ - { - "package": "utopia-php/database", - "version": "dev-feat-internal-indexes", - "alias": "0.17.1", - "alias_normalized": "0.17.1.0" - } - ], + "aliases": [], "minimum-stability": "stable", - "stability-flags": { - "utopia-php/database": 20 - }, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": {