在Doctrine 2中指定表类型/存储引擎 [英] Specify the table type/storage engine in Doctrine 2

查看:106
本文介绍了在Doctrine 2中指定表类型/存储引擎的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

那么在Doctrine 2中如何指定一个给定实体的存储引擎呢?



我正在创建一个需要全文索引的表,只有MyISAM存储引擎支持MySQL中的全文索引。



作为一面:看起来Doctrine 2不支持开箱即用的全文索引?也不是全文搜索?这是正确的吗?

解决方案

我两年太晚了,但知道这一点很重要,因为一些没有记录原因,
我们一直在努力实现这一点,但这是解决方案

  / ** 
* ReportData
*
* @ ORM\Table(name =reports_report_data,options = {engine:MyISAM})
* @ ORM\Entity(repositoryClass =Jac \ReportGeneratorBundle\Entity\ReportDataRepository)
* /
class ReportData
{


So how can one specify the storage engine to use for a given entity in Doctrine 2?

I'm creating a table that needs a full text index and only the MyISAM storage engine supports full text indexing in MySQL.

As a side: it looks like Doctrine 2 doesn't support full text indexing out of the box? Nor full text searches? Is that correct?

解决方案

I'm two years too late, but knowing this is important since it isn't documented for some reason, we have been struggling to achieve this but this is the solution

/**
 * ReportData
 *
 * @ORM\Table(name="reports_report_data",options={"engine":"MyISAM"})
 * @ORM\Entity(repositoryClass="Jac\ReportGeneratorBundle\Entity\ReportDataRepository")
 */
class ReportData
{

这篇关于在Doctrine 2中指定表类型/存储引擎的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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