fix: use bigint for large integers
This commit is contained in:
parent
d8f71acc3f
commit
2015106702
|
@ -973,10 +973,12 @@ App::post('/v1/database/collections/:collectionId/attributes/integer')
|
||||||
throw new Exception($validator->getDescription(), 400);
|
throw new Exception($validator->getDescription(), 400);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$size = $max > 2147483647 ? 8 : 4; // Automatically create BigInt depending on max value
|
||||||
|
|
||||||
$attribute = createAttribute($collectionId, new Document([
|
$attribute = createAttribute($collectionId, new Document([
|
||||||
'key' => $key,
|
'key' => $key,
|
||||||
'type' => Database::VAR_INTEGER,
|
'type' => Database::VAR_INTEGER,
|
||||||
'size' => 0,
|
'size' => $size,
|
||||||
'required' => $required,
|
'required' => $required,
|
||||||
'default' => $default,
|
'default' => $default,
|
||||||
'array' => $array,
|
'array' => $array,
|
||||||
|
|
Loading…
Reference in a new issue