2017-05-18 18:59:57 +02:00
|
|
|
<?php
|
|
|
|
namespace SilverStripe\ORM\Tests\DataObjectSchemaTest;
|
|
|
|
|
|
|
|
use SilverStripe\Dev\TestOnly;
|
|
|
|
use SilverStripe\ORM\DataObject;
|
2017-07-04 11:58:07 +02:00
|
|
|
use SilverStripe\ORM\FieldType\DBIndexable;
|
2017-05-18 18:59:57 +02:00
|
|
|
|
2019-02-27 03:12:26 +01:00
|
|
|
/**
|
|
|
|
* @property int $Number
|
|
|
|
* @property string $Content
|
|
|
|
* @property string $Title
|
|
|
|
*/
|
2017-05-18 18:59:57 +02:00
|
|
|
class AllIndexes extends DataObject implements TestOnly
|
|
|
|
{
|
|
|
|
private static $table_name = 'DataObjectSchemaTest_AllIndexes';
|
|
|
|
|
|
|
|
private static $db = [
|
|
|
|
'Title' => 'Varchar',
|
|
|
|
'Content' => 'Varchar',
|
|
|
|
'Number' => 'Int',
|
|
|
|
];
|
|
|
|
|
|
|
|
private static $indexes = [
|
|
|
|
'Content' => true,
|
|
|
|
'IndexCols' => ['Title', 'Content'],
|
|
|
|
'IndexUnique' => [
|
2017-07-04 11:58:07 +02:00
|
|
|
'type' => DBIndexable::TYPE_UNIQUE,
|
2017-05-18 18:59:57 +02:00
|
|
|
'columns' => ['Number'],
|
|
|
|
],
|
|
|
|
'IndexNormal' => [
|
|
|
|
'columns' => ['Title'],
|
|
|
|
],
|
|
|
|
];
|
|
|
|
}
|