CropStorageSchema.php in Crop API 8.2
File
src/CropStorageSchema.php
View source
<?php
namespace Drupal\crop;
use Drupal\Core\Entity\ContentEntityTypeInterface;
use Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema;
class CropStorageSchema extends SqlContentEntityStorageSchema {
protected function getEntitySchema(ContentEntityTypeInterface $entity_type, $reset = FALSE) {
$schema = parent::getEntitySchema($entity_type, $reset);
if ($data_table = $this->storage
->getDataTable()) {
$schema[$data_table]['indexes'] += [
'crop__uri_type' => [
'uri',
'type',
],
];
}
return $schema;
}
}