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';
|
2017-05-18 18:59:57 +02:00
|
|
|
private static $db = [
|
2018-11-09 04:23:50 +01:00
|
|
|
'Title' => 'Varchar(192)',
|
2017-05-18 18:59:57 +02:00
|
|
|
'Content' => 'Text',
|
|
|
|
];
|
2016-10-14 03:30:05 +02:00
|
|
|
|
2017-05-18 18:59:57 +02:00
|
|
|
private static $indexes = [
|
|
|
|
'NameIndex' => [
|
|
|
|
'type' => 'unique',
|
|
|
|
'columns' => ['Title'],
|
|
|
|
],
|
|
|
|
'SearchFields' => [
|
2016-12-16 05:34:21 +01:00
|
|
|
'type' => 'fulltext',
|
|
|
|
'name' => 'SearchFields',
|
2017-05-18 18:59:57 +02:00
|
|
|
'columns' => ['Title', 'Content'],
|
|
|
|
],
|
|
|
|
];
|
2016-10-14 03:30:05 +02:00
|
|
|
|
2016-12-16 05:34:21 +01:00
|
|
|
/**
|
2017-05-18 18:59:57 +02:00
|
|
|
* @config
|
|
|
|
*/
|
|
|
|
private static $indexes_alt = [
|
|
|
|
'NameIndex' => [
|
2016-12-16 05:34:21 +01:00
|
|
|
'type' => 'unique',
|
|
|
|
'name' => 'NameIndex',
|
2017-05-18 18:59:57 +02:00
|
|
|
'columns' => ['Title'],
|
|
|
|
],
|
|
|
|
'SearchFields' => [
|
|
|
|
'type' => 'fulltext',
|
|
|
|
'columns' => ['Title', 'Content'],
|
|
|
|
],
|
|
|
|
];
|
2016-10-14 03:30:05 +02:00
|
|
|
}
|