关于我的申请的一些背景:
- ZF2 申请
- 学说/dbal v2.5.12
- 教义/orm v2.5.6
- 原则/迁移 v1.5.0
问题:如果我运行命令 migrations:diff
从我的实体类中的更改生成迁移,我会得到以下异常:
[Doctrine\DBAL\DBALException] Unknown column type "json" requested.
Any Doctrine type that you use has to be registered with \Doctrine\DBAL\Types\Type::addType(). You can get a list of all the known types with \Doctrine\DBAL\Types\Type::getTypesMap().
最佳答案
问题是 doctrine/dbal
版本 2.5.x
不支持 MySQL 中的 JSON 字段。
将 composer.json
中的 doctrine/dbal
版本升级到 ^2.6
,它应该可以工作。确保在 release changelog 中检查破坏兼容性的更改
关于php - 未知列类型 "json"请求运行 Doctrine 2 迁移,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43474145/