@@ -2122,6 +2122,10 @@ public function createAttribute(string $collection, string $id, string $type, in
21222122 $ filters = array_unique ($ filters );
21232123 }
21242124
2125+ if ($ type === self ::VAR_BIGINT ) {
2126+ $ size = 0 ;
2127+ }
2128+
21252129 $ existsInSchema = false ;
21262130
21272131 $ schemaAttributes = $ this ->adapter ->getSupportForSchemaAttributes ()
@@ -2315,6 +2319,10 @@ public function createAttributes(string $collection, array $attributes): bool
23152319 $ attribute ['filters ' ] = [];
23162320 }
23172321
2322+ if ($ attribute ['type ' ] === self ::VAR_BIGINT ) {
2323+ $ attribute ['size ' ] = 0 ;
2324+ }
2325+
23182326 $ existsInSchema = false ;
23192327
23202328 try {
@@ -2487,6 +2495,10 @@ private function validateAttribute(
24872495 array $ filters ,
24882496 ?array $ schemaAttributes = null
24892497 ): Document {
2498+ if ($ type === self ::VAR_BIGINT ) {
2499+ $ size = 0 ;
2500+ }
2501+
24902502 $ attribute = new Document ([
24912503 '$id ' => ID ::custom ($ id ),
24922504 'key ' => $ id ,
@@ -2519,12 +2531,12 @@ private function validateAttribute(
25192531 supportForVectors: $ this ->adapter ->getSupportForVectors (),
25202532 supportForSpatialAttributes: $ this ->adapter ->getSupportForSpatialAttributes (),
25212533 supportForObject: $ this ->adapter ->getSupportForObject (),
2534+ supportUnsignedBigInt: $ this ->adapter ->getSupportForUnsignedBigInt (),
25222535 attributeCountCallback: fn () => $ this ->adapter ->getCountOfAttributes ($ collectionClone ),
25232536 attributeWidthCallback: fn () => $ this ->adapter ->getAttributeWidth ($ collectionClone ),
25242537 filterCallback: fn ($ id ) => $ this ->adapter ->filter ($ id ),
25252538 isMigrating: $ this ->isMigrating (),
25262539 sharedTables: $ this ->getSharedTables (),
2527- supportUnsignedBigInt: $ this ->adapter ->getSupportForUnsignedBigInt (),
25282540 );
25292541
25302542 $ validator ->isValid ($ attribute );
@@ -2877,6 +2889,10 @@ public function updateAttribute(string $collection, string $id, ?string $type =
28772889 $ formatOptions ??= $ attribute ->getAttribute ('formatOptions ' );
28782890 $ filters ??= $ attribute ->getAttribute ('filters ' );
28792891
2892+ if ($ type === self ::VAR_BIGINT ) {
2893+ $ size = 0 ;
2894+ }
2895+
28802896 if ($ required === true && !\is_null ($ default )) {
28812897 $ default = null ;
28822898 }
@@ -2920,14 +2936,6 @@ public function updateAttribute(string $collection, string $id, ?string $type =
29202936 }
29212937 break ;
29222938 case self ::VAR_BIGINT :
2923- $ sizeString = BigIntValidator::normalizeUnsignedString ((string )$ size );
2924- $ limit = (!$ signed && $ this ->adapter ->getSupportForUnsignedBigInt ())
2925- ? BigIntValidator::UNSIGNED_MAX
2926- : BigIntValidator::SIGNED_MAX ;
2927-
2928- if (BigIntValidator::compareUnsignedStrings ($ sizeString , $ limit ) > 0 ) {
2929- throw new DatabaseException ('Max size allowed for bigint is: ' . BigIntValidator::formatIntegerString ($ limit ));
2930- }
29312939 break ;
29322940 case self ::VAR_FLOAT :
29332941 case self ::VAR_BOOLEAN :
@@ -5599,8 +5607,8 @@ public function createDocument(string $collection, Document $document): Document
55995607 $ this ->adapter ->getMinDateTime (),
56005608 $ this ->adapter ->getMaxDateTime (),
56015609 $ this ->adapter ->getSupportForAttributes (),
5602- null ,
5603- $ this -> adapter -> getSupportForUnsignedBigInt ()
5610+ $ this -> adapter -> getSupportForUnsignedBigInt () ,
5611+ null
56045612 );
56055613 if (!$ structure ->isValid ($ document )) {
56065614 throw new StructureException ($ structure ->getDescription ());
@@ -5709,8 +5717,8 @@ public function createDocuments(
57095717 $ this ->adapter ->getMinDateTime (),
57105718 $ this ->adapter ->getMaxDateTime (),
57115719 $ this ->adapter ->getSupportForAttributes (),
5712- null ,
5713- $ this -> adapter -> getSupportForUnsignedBigInt ()
5720+ $ this -> adapter -> getSupportForUnsignedBigInt () ,
5721+ null
57145722 );
57155723 if (!$ validator ->isValid ($ document )) {
57165724 throw new StructureException ($ validator ->getDescription ());
@@ -6282,8 +6290,8 @@ public function updateDocument(string $collection, string $id, Document $documen
62826290 $ this ->adapter ->getMinDateTime (),
62836291 $ this ->adapter ->getMaxDateTime (),
62846292 $ this ->adapter ->getSupportForAttributes (),
6285- $ old ,
6286- $ this -> adapter -> getSupportForUnsignedBigInt ()
6293+ $ this -> adapter -> getSupportForUnsignedBigInt () ,
6294+ $ old
62876295 );
62886296 if (!$ structureValidator ->isValid ($ document )) { // Make sure updated structure still apply collection rules (if any)
62896297 throw new StructureException ($ structureValidator ->getDescription ());
@@ -7297,8 +7305,8 @@ public function upsertDocumentsWithIncrease(
72977305 $ this ->adapter ->getMinDateTime (),
72987306 $ this ->adapter ->getMaxDateTime (),
72997307 $ this ->adapter ->getSupportForAttributes (),
7300- $ old -> isEmpty () ? null : $ old ,
7301- $ this -> adapter -> getSupportForUnsignedBigInt ()
7308+ $ this -> adapter -> getSupportForUnsignedBigInt () ,
7309+ $ old -> isEmpty () ? null : $ old
73027310 );
73037311
73047312 if (!$ validator ->isValid ($ document )) {
0 commit comments