Version 1
[yaffs-website] / web / core / modules / menu_link_content / src / MenuLinkContentStorageSchema.php
diff --git a/web/core/modules/menu_link_content/src/MenuLinkContentStorageSchema.php b/web/core/modules/menu_link_content/src/MenuLinkContentStorageSchema.php
new file mode 100644 (file)
index 0000000..e5c7ab5
--- /dev/null
@@ -0,0 +1,31 @@
+<?php
+
+namespace Drupal\menu_link_content;
+
+use Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema;
+use Drupal\Core\Field\FieldStorageDefinitionInterface;
+
+/**
+ * Defines the menu_link_content schema handler.
+ */
+class MenuLinkContentStorageSchema extends SqlContentEntityStorageSchema {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function getSharedTableFieldSchema(FieldStorageDefinitionInterface $storage_definition, $table_name, array $column_mapping) {
+    $schema = parent::getSharedTableFieldSchema($storage_definition, $table_name, $column_mapping);
+    $field_name = $storage_definition->getName();
+
+    if ($table_name == 'menu_link_content') {
+      switch ($field_name) {
+        case 'rediscover':
+          $this->addSharedTableFieldIndex($storage_definition, $schema, TRUE);
+          break;
+      }
+    }
+
+    return $schema;
+  }
+
+}