Skip to content

Commit ba45e22

Browse files
Enhance attribute validation to support string type for big integers
- Updated the validation logic in the `Attribute` class to allow for string types as valid default values for `bigint` attributes, improving type flexibility and error handling.
1 parent dbe3537 commit ba45e22

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Database/Validator/Attribute.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ protected function validateDefaultTypes(string $type, mixed $default): void
552552
}
553553
break;
554554
case Database::VAR_BIGINT:
555-
if ($defaultType !== 'integer') {
555+
if ($defaultType !== 'integer' && $defaultType !== 'string') {
556556
$this->message = 'Default value ' . $default . ' does not match given type ' . $type;
557557
throw new DatabaseException($this->message);
558558
}

0 commit comments

Comments
 (0)