eeb7ff4a6d
Support for Partial Indexes was available in Doctrine 1 following http://www.doctrine-project.org/jira/browse/DC-82. This commit reintroduce support for Doctrine 2. We use the same syntax with an optionnal "where" attribute for Index and UniqueConstraint.
21 lines
525 B
PHP
21 lines
525 B
PHP
<?php
|
|
|
|
use Doctrine\ORM\Mapping\ClassMetadataInfo;
|
|
|
|
$metadata->setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_NONE);
|
|
$metadata->setPrimaryTable(array(
|
|
'indexes' => array(
|
|
array('columns' => array('content'), 'flags' => array('fulltext'), 'where' => 'content IS NOT NULL')
|
|
)
|
|
));
|
|
|
|
$metadata->mapField(array(
|
|
'fieldName' => 'content',
|
|
'type' => 'text',
|
|
'scale' => 0,
|
|
'length' => NULL,
|
|
'unique' => false,
|
|
'nullable' => false,
|
|
'precision' => 0,
|
|
'columnName' => 'content',
|
|
)); |