Php Doctrine2/orm:schema工具:每次更新同一查询时执行
我有一个Php Doctrine2/orm:schema工具:每次更新同一查询时执行,php,doctrine-orm,Php,Doctrine Orm,我有一个客户实体,在参考属性/表列上有一个唯一的索引 /** * @ORM\Entity * @ORM\Table(name="clients", uniqueConstraints={@ORM\UniqueConstraint(name="client_reference_idx", columns={"reference"}, options={"where": "(reference IS NOT NULL) AND (reference <> '')"})}) * *
客户
实体,在参考
属性/表列上有一个唯一的索引
/**
* @ORM\Entity
* @ORM\Table(name="clients", uniqueConstraints={@ORM\UniqueConstraint(name="client_reference_idx", columns={"reference"}, options={"where": "(reference IS NOT NULL) AND (reference <> '')"})})
*
*/
class Client
{
//...
我有其他具有唯一约束的实体,但只有这个实体具有带有WHERE
子句的约束
怎么了
DROP INDEX client_reference_idx;
CREATE UNIQUE INDEX client_reference_idx ON clients (reference) WHERE (reference IS NOT NULL) AND (reference <> '');