TaskStorageSchema.php in Search API 8
File
src/Entity/TaskStorageSchema.php
View source
<?php
namespace Drupal\search_api\Entity;
use Drupal\Core\Entity\ContentEntityTypeInterface;
use Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema;
class TaskStorageSchema extends SqlContentEntityStorageSchema {
protected function getEntitySchema(ContentEntityTypeInterface $entity_type, $reset = FALSE) : array {
$schema = parent::getEntitySchema($entity_type, $reset);
if ($data_table = $this->storage
->getBaseTable()) {
$data = 'data';
if ($this->database
->driver() === 'mysql') {
$data = [
'data',
255,
];
}
$schema[$data_table]['unique keys'] += [
'task__unique' => [
'type',
'server_id',
'index_id',
$data,
],
];
}
return $schema;
}
}