From 032673134849d1833e22f16859100f4e6eaa07f7 Mon Sep 17 00:00:00 2001 From: Kristian Mide Date: Thu, 26 Sep 2013 14:41:06 +0200 Subject: [PATCH] Respect unsigned fields when tables get converted to entities. This is working on our mysql setup, however i have no idea of the consequences of this change when using other RDBMSes. --- lib/Doctrine/ORM/Tools/EntityGenerator.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Tools/EntityGenerator.php b/lib/Doctrine/ORM/Tools/EntityGenerator.php index 5bbaf280c..c497f5761 100644 --- a/lib/Doctrine/ORM/Tools/EntityGenerator.php +++ b/lib/Doctrine/ORM/Tools/EntityGenerator.php @@ -1430,7 +1430,11 @@ public function __construct() if (isset($fieldMapping['nullable'])) { $column[] = 'nullable=' . var_export($fieldMapping['nullable'], true); } - + + if (isset($fieldMapping['unsigned']) && $fieldMapping['unsigned']) { + $column[] = 'options={"unsigned"=true}'; + } + if (isset($fieldMapping['columnDefinition'])) { $column[] = 'columnDefinition="' . $fieldMapping['columnDefinition'] . '"'; }