From 277edbc10ac89fc5d4c2911b3f96ce417e7d9686 Mon Sep 17 00:00:00 2001 From: Artur Bodera Date: Tue, 26 Nov 2013 18:54:54 +0100 Subject: [PATCH] Fix integer values overflowing on signed INTEGER columns. Doctrine does not hint or support unsigned schema columns, which means that by default columns will be signed in many DBMS - i.e. in MySQL this means that the max value for `INTEGER` column is 2147483647. --- src/Faker/ORM/Doctrine/ColumnTypeGuesser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Faker/ORM/Doctrine/ColumnTypeGuesser.php b/src/Faker/ORM/Doctrine/ColumnTypeGuesser.php index e47be30e..10d8bae8 100644 --- a/src/Faker/ORM/Doctrine/ColumnTypeGuesser.php +++ b/src/Faker/ORM/Doctrine/ColumnTypeGuesser.php @@ -27,7 +27,7 @@ class ColumnTypeGuesser case 'smallint': return function() { return mt_rand(0,65535); }; case 'integer': - return function() { return mt_rand(0,intval('4294967295')); }; + return function() { return mt_rand(0,intval('2147483647')); }; case 'bigint': return function() { return mt_rand(0,intval('18446744073709551615')); }; case 'float':