mysql tinyint(2) 的错误映射为 boolean 与学说 [英] Incorrect mapping of mysql tinyint(2) as boolean with doctrine

查看:54
本文介绍了mysql tinyint(2) 的错误映射为 boolean 与学说的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 symfony2 逆向设计了我的数据库,并使用命令对我的数据库进行了逆向工程:

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

但我的字段被映射为布尔值而不是 tinyint(2).

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

为什么它映射为布尔值?

Why it is mapping as boolean?

推荐答案

tinyint(不分长度)映射到MySQL DBAL平台.

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) 的错误映射为 boolean 与学说的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆