1
0
Fork 0
mirror of synced 2024-05-20 12:42:39 +12:00

fix: use bigint for large integers

This commit is contained in:
Torsten Dittmann 2021-12-29 15:50:21 +01:00
parent d8f71acc3f
commit 2015106702

View file

@ -973,10 +973,12 @@ App::post('/v1/database/collections/:collectionId/attributes/integer')
throw new Exception($validator->getDescription(), 400);
}
$size = $max > 2147483647 ? 8 : 4; // Automatically create BigInt depending on max value
$attribute = createAttribute($collectionId, new Document([
'key' => $key,
'type' => Database::VAR_INTEGER,
'size' => 0,
'size' => $size,
'required' => $required,
'default' => $default,
'array' => $array,