2016-10-14 03:30:05 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace SilverStripe\ORM\Tests\DataObjectSchemaGenerationTest;
|
|
|
|
|
|
|
|
use SilverStripe\Dev\TestOnly;
|
|
|
|
|
|
|
|
class TestIndexObject extends TestObject implements TestOnly
|
|
|
|
{
|
2016-12-16 05:34:21 +01:00
|
|
|
private static $table_name = 'DataObjectSchemaGenerationTest_IndexDO';
|
|
|
|
private static $db = array(
|
|
|
|
'Title' => 'Varchar(255)',
|
|
|
|
'Content' => 'Text'
|
|
|
|
);
|
2016-10-14 03:30:05 +02:00
|
|
|
|
2016-12-16 05:34:21 +01:00
|
|
|
private static $indexes = array(
|
|
|
|
'NameIndex' => 'unique ("Title")',
|
|
|
|
'SearchFields' => array(
|
|
|
|
'type' => 'fulltext',
|
|
|
|
'name' => 'SearchFields',
|
|
|
|
'value' => '"Title","Content"'
|
|
|
|
)
|
|
|
|
);
|
2016-10-14 03:30:05 +02:00
|
|
|
|
2016-12-16 05:34:21 +01:00
|
|
|
/**
|
|
|
|
* @config
|
|
|
|
*/
|
|
|
|
private static $indexes_alt = array(
|
|
|
|
'NameIndex' => array(
|
|
|
|
'type' => 'unique',
|
|
|
|
'name' => 'NameIndex',
|
|
|
|
'value' => '"Title"'
|
|
|
|
),
|
|
|
|
'SearchFields' => 'fulltext ("Title","Content")'
|
|
|
|
);
|
2016-10-14 03:30:05 +02:00
|
|
|
}
|