跑步时doctrine:mapping:import
我收到错误:
请求未知的数据库类型枚举,Doctrine\DBAL\Platforms\MySqlPlatform 可能不支持它。
看来我需要设置use_native_enum
to true
不知何故。但是,所有文档和博客文章均引用 Symfony
对于 Symfony 2 项目,将其添加到 dbal 配置中app/config.yml
:
doctrine:
dbal:
mapping_types:
enum: string
我的完整学说配置如下所示:
# Doctrine Configuration
doctrine:
dbal:
driver: %database_driver%
host: %database_host%
port: %database_port%
dbname: %database_name%
user: %database_user%
password: %database_password%
charset: UTF8
mapping_types:
enum: string
set: string
varbinary: string
tinyblob: text
orm:
auto_generate_proxy_classes: %kernel.debug%
auto_mapping: true
代码改编自here http://blog.alterphp.com/2011/09/deal-with-mysql-types-natively.html
然后运行:
app/console doctrine:schema:update --force --dump-sql --ansi
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)