diff --git a/core/lib/Drupal/Core/Entity/FieldableDatabaseStorageController.php b/core/lib/Drupal/Core/Entity/FieldableDatabaseStorageController.php
index 282987d..4c34afd 100644
--- a/core/lib/Drupal/Core/Entity/FieldableDatabaseStorageController.php
+++ b/core/lib/Drupal/Core/Entity/FieldableDatabaseStorageController.php
@@ -1458,4 +1458,85 @@ static public function _fieldColumnName(FieldInterface $field, $column) {
     return in_array($column, Field::getReservedColumns()) ? $column : $field->getName() . '_' . $column;
   }
 
+  /**
+   * Gets the schema for this entity type.
+   *
+   * @return array|null
+   *   Returns the schema definitions for the entity type's tables. If the
+   *   entity type does not have a schema, returns NULL.
+   */
+  public function getSchema() {
+    $entity_type = $this->entityType();
+    $entity_info = $this->entityInfo();
+
+    $base_table = $entity_info->getBaseTable();
+
+    // If the entity type does not have a base table there is no point in
+    // generating a schema.
+    if (!$base_table) {
+      return;
+    }
+
+    $schema[$base_table]['description'] = "The base table for $entity_type entities.";
+    if ($revision_table = $entity_info->getRevisionTable()) {
+      $schema[$revision_table]['description'] = "The base table for $entity_type revisions.";
+    }
+    if ($data_table = $entity_info->getDataTable()) {
+      $schema[$data_table]['description'] = "The data table for $entity_type entities.";
+    }
+    if ($revision_data_table = $entity_info->getRevisionDataTable()) {
+      $schema[$revision_data_table]['description'] = "The data table for $entity_type revisions.'";
+    }
+
+    $entity_keys = $entity_info->getKeys();
+
+    $class = $this->entityClass;
+    // Invoke ContentEntityInterface::baseFieldDefinitions() directly. Avoid any
+    // info or alter hooks.
+    foreach($class::baseFieldDefinitions($entity_type) as $field_name => $field_definition) {
+      $field_schema = array();
+
+      /** @var \Drupal\Core\Field\FieldDefinitionInterface $field_definition */
+      $definition_schema = $field_definition->getSchema();
+      if (count($definition_schema['columns']) == 1) {
+        $field_schema = reset($definition_schema['columns']);
+      }
+      else {
+        $columns = implode(', ', array_keys($definition_schema['columns']));
+        throw new \Exception("Entity type: $entity_type, Field name: $field_name, Columns: $columns");
+      }
+
+      if ($field_name == $entity_keys['id'] && $field_definition->getType() == 'unsigned_integer') {
+        $field_schema['type'] = 'serial';
+        unset($field_schema['unsigned'], $field_schema['default']);
+
+        $schema[$base_table]['primary key'][] = $field_name;
+      }
+
+      $field_schema['description'] = $field_definition->getDescription();
+
+      // Depending on which tables this entity provides add the appropriate
+      // fields to the appropriate tables:
+      $tables = array();
+      // For entity types without a data table all fields are stored in the base
+      // table. For entity types with a data table only the entity fields
+      // which do not vary by language are stored in the base table.
+      if (!$data_table || in_array($field_name, array_diff_key($entity_keys, array('label' => TRUE)))) {
+        $tables[] = $base_table;
+      }
+
+      foreach ($tables as $table) {
+        $schema[$table]['fields'][$field_name] = $field_schema;
+      }
+
+      // Add indexes.
+      if (!empty($definition_schema['indexes'])) {
+
+      }
+    }
+
+    return $schema;
+  }
+
+
 }
