1
0
mirror of synced 2025-01-25 09:41:40 +03:00
doctrine2/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.Comment.php
Adrien Crivelli eeb7ff4a6d Support for Partial Indexes for PostgreSql and Sqlite
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.
2014-07-22 10:32:30 +09:00

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',
));