使用symfony2将mysql枚举迁移到原则实体的最佳策略? [英] Best strategy for migrating mysql enums to doctrine entities with symfony2?
本文介绍了使用symfony2将mysql枚举迁移到原则实体的最佳策略?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
你有两个解决方案
- 解决方案1:映射到Varchars
- 解决方案2:定义类型
了解更多信息,请参阅以下链接: Mysql Enums doctrine
I am currently in the process of migrating a legacy app over to symfony2, the problem is that I have a lot of mysql enum columns, I know that doctrine does not support enum data types and that one workaround is to store as a string but I would really lose the ability to properly sort the data because varchars are a lot slower, I do have a lot of tables with the enum data types and modifying the schema would be really hard, what are my options?? What can you suggest that will make a transition to symfony2 a lot smoother?
解决方案
You have two solution
- Solution 1: Mapping to Varchars
- Solution 2: Defining a Type
for more information please consult this link: Mysql Enums doctrine
这篇关于使用symfony2将mysql枚举迁移到原则实体的最佳策略?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文