Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Incorrect mapping of mysql tinyint(2) as boolean with doctrine

I reverse engineered my database with symfony2 and doctrine with commands :

php app/console doctrine:mapping:convert
php app/console doctrine:mapping:import
php app/console doctrine:generate:entities

But my field was mapped as boolean instead of tinyint(2).

Why it is mapping as boolean?

like image 857
Mohammed H Avatar asked Feb 04 '13 06:02

Mohammed H


1 Answers

tinyint (regardless of length) is mapped to type boolean in the MySQL DBAL platform.

Also, consider that the entity generator is not a reliable tool: it was just meant to give you some help in getting started with larger schemas.

like image 101
Ocramius Avatar answered Sep 30 '22 14:09

Ocramius