mysql tinyint(2)作为布尔与doctrine映射不正确 [英] Incorrect mapping of mysql tinyint(2) as boolean with doctrine
本文介绍了mysql tinyint(2)作为布尔与doctrine映射不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
php app / console doctrine:mapping:convert
php app / console doctrine:mapping:import
php app / console doctrine:generate:entities
但是我的字段被映射为布尔值而不是tinyint(2)。
为什么映射为boolean?
解决方案
tinyint
(不管长度)被映射到类型 boolean
在 MySQL DBAL平台。
另外,实体生成器不是一个可靠的工具:它只是为了给您一些帮助,开始使用更大的模式。
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?
解决方案
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.
这篇关于mysql tinyint(2)作为布尔与doctrine映射不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文