简体   繁体   中英

Setting the key on an Index for a Blob field using Doctrine2 annotations in Symfony2?

I can currently setup any indexes I might need on a table using annotations in Symfony2 and Doctrine2, but there doesn't seem to be a way to add a key to the index if I want to use a Blob.

I am using the example from the documentation:

/**
 * @Entity
 * @Table(name="ecommerce_products",indexes={@index(name="search_idx", columns={"name", "email"})})
 */

The problem with this is that I can't use Blob field types as I can't seem to set the length of the key.

In MySql you would use something like "name(100)", but this doesn't work in the annotations above.

There is a ticket in Jira http://www.doctrine-project.org/jira/browse/DDC-2802

And they are not going to fix this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM