e034362f109e316c565ab66f50fb52824e1bb654
[yaffs-website] / web / modules / contrib / redirect / src / RedirectStorageSchema.php
1 <?php
2
3 namespace Drupal\redirect;
4
5 use Drupal\Core\Entity\ContentEntityTypeInterface;
6 use Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema;
7
8 /**
9  * Defines the redirect schema.
10  */
11 class RedirectStorageSchema extends SqlContentEntityStorageSchema {
12
13   /**
14    * {@inheritdoc}
15    */
16   protected function getEntitySchema(ContentEntityTypeInterface $entity_type, $reset = FALSE) {
17     $schema = parent::getEntitySchema($entity_type, $reset);
18
19     // Add indexes.
20     $schema['redirect']['unique keys'] += [
21       'hash' => ['hash'],
22     ];
23     $schema['redirect']['indexes'] += [
24       // Limit length to 191.
25       'source_language' => [['redirect_source__path', 191], 'language'],
26     ];
27
28     return $schema;
29   }
30
31 }