[PR #11414] Fix BIGINT validation #13007

Closed
opened 2026-01-22 16:15:52 +01:00 by admin · 0 comments
Owner

Original Pull Request: https://github.com/doctrine/orm/pull/11414

State: closed
Merged: Yes


Fixes #11377.

Our schema validation currently fails if we map a BIGINT column to a property with an int PHP type. While this is technically correct because DBAL 3 hydrates BIGINT values as strings, the error is also unnecessarily strict:

The ORM will cast strings returned by DBAL back to int, if that's the property type. The value range of BIGINT and PHP's int (on 64bit machines) is the same. Storing BIGINT values as string is only necessary if we run on 32bit PHP or we deal with BIGINT UNSIGNED on MySQL/MariaDB. Both are edge cases a project may validly choose to ignore.

Emitting this error encourages downstream projects to change their property types of BIGINT columns from int to string which is unfortunate given that DBAL 4 moved towards returning integers if possible.

**Original Pull Request:** https://github.com/doctrine/orm/pull/11414 **State:** closed **Merged:** Yes --- Fixes #11377. Our schema validation currently fails if we map a `BIGINT` column to a property with an `int` PHP type. While this is technically correct because DBAL 3 hydrates `BIGINT` values as strings, the error is also unnecessarily strict: The ORM will cast strings returned by DBAL back to `int`, if that's the property type. The value range of `BIGINT` and PHP's int (on 64bit machines) is the same. Storing `BIGINT` values as string is only necessary if we run on 32bit PHP or we deal with `BIGINT UNSIGNED` on MySQL/MariaDB. Both are edge cases a project may validly choose to ignore. Emitting this error encourages downstream projects to change their property types of `BIGINT` columns from `int` to `string` which is unfortunate given that DBAL 4 moved towards returning integers if possible.
admin added the pull-request label 2026-01-22 16:15:52 +01:00
admin closed this issue 2026-01-22 16:15:52 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#13007