Version 1
[yaffs-website] / web / modules / contrib / fontyourface / src / FontStorageSchema.php
diff --git a/web/modules/contrib/fontyourface/src/FontStorageSchema.php b/web/modules/contrib/fontyourface/src/FontStorageSchema.php
new file mode 100644 (file)
index 0000000..a4fef8c
--- /dev/null
@@ -0,0 +1,30 @@
+<?php
+
+namespace Drupal\fontyourface;
+
+use Drupal\Core\Entity\ContentEntityTypeInterface;
+use Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema;
+
+/**
+ * Defines the font schema handler.
+ */
+class FontStorageSchema extends SqlContentEntityStorageSchema {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function getEntitySchema(ContentEntityTypeInterface $entity_type, $reset = FALSE) {
+    $schema = parent::getEntitySchema($entity_type, $reset);
+
+    $schema['fontyourface_font']['indexes'] += [
+      'name' => ['name'],
+      'pid' => ['pid'],
+    ];
+    $schema['fontyourface_font']['unique keys'] += [
+      'url' => ['url'],
+    ];
+
+    return $schema;
+  }
+
+}