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);