diff --git a/core/core.services.yml b/core/core.services.yml
index c43da8c..3bf30ab 100644
--- a/core/core.services.yml
+++ b/core/core.services.yml
@@ -285,6 +285,9 @@ services:
     parent: container.trait
     tags:
       - { name: plugin_manager_cache_clear }
+  entity.schema.manager:
+    class: Drupal\Core\Entity\Schema\ContentEntitySchemaManager
+    arguments: ['@entity.manager', '@state']
   entity.form_builder:
     class: Drupal\Core\Entity\EntityFormBuilder
     arguments: ['@entity.manager', '@form_builder']
diff --git a/core/includes/update.inc b/core/includes/update.inc
index f9a88db..c00f591 100644
--- a/core/includes/update.inc
+++ b/core/includes/update.inc
@@ -13,6 +13,7 @@
 use Drupal\Core\Config\FileStorage;
 use Drupal\Core\Config\ConfigException;
 use Drupal\Core\DrupalKernel;
+use Drupal\Core\Entity\EntityStorageException;
 use Drupal\Core\Page\DefaultHtmlPageRenderer;
 use Drupal\Core\Utility\Error;
 use Drupal\Component\Uuid\Uuid;
@@ -258,6 +259,33 @@ function update_do_one($module, $number, $dependency_map, &$context) {
 }
 
 /**
+ * Performs entity schema updates.
+ *
+ * @param $module
+ *   The module whose update will be run.
+ * @param $number
+ *   The update number to run.
+ * @param $context
+ *   The batch context array.
+ */
+function update_entity_schema($module, $number, &$context) {
+  try {
+    \Drupal::service('entity.schema.manager')->applyChanges();
+  }
+  catch (EntityStorageException $e) {
+    watchdog_exception('update', $e);
+    $variables = Error::decodeException($e);
+    unset($variables['backtrace']);
+    // The exception message is run through
+    // \Drupal\Component\Utility\String::checkPlain() by
+    // \Drupal\Core\Utility\Error::decodeException().
+    $ret['#abort'] = array('success' => FALSE, 'query' => t('%type: !message in %function (line %line of %file).', $variables));
+    $context['results'][$module][$number] = $ret;
+    $context['results']['#abort'][] = 'update_entity_schema';
+  }
+}
+
+/**
  * Returns a list of all the pending database updates.
  *
  * @return
@@ -428,15 +456,17 @@ function update_get_update_function_list($starting_updates) {
   // Go through each module and find all updates that we need (including the
   // first update that was requested and any updates that run after it).
   $update_functions = array();
-  foreach ($starting_updates as $module => $version) {
-    $update_functions[$module] = array();
-    $updates = drupal_get_schema_versions($module);
-    if ($updates !== FALSE) {
-      $max_version = max($updates);
-      if ($version <= $max_version) {
-        foreach ($updates as $update) {
-          if ($update >= $version) {
-            $update_functions[$module][$update] = $module . '_update_' . $update;
+  if ($starting_updates) {
+    foreach ($starting_updates as $module => $version) {
+      $update_functions[$module] = array();
+      $updates = drupal_get_schema_versions($module);
+      if ($updates !== FALSE) {
+        $max_version = max($updates);
+        if ($version <= $max_version) {
+          foreach ($updates as $update) {
+            if ($update >= $version) {
+              $update_functions[$module][$update] = $module . '_update_' . $update;
+            }
           }
         }
       }
diff --git a/core/lib/Drupal/Core/Entity/ContentEntityDatabaseStorage.php b/core/lib/Drupal/Core/Entity/ContentEntityDatabaseStorage.php
index 2d45275..4a20f49 100644
--- a/core/lib/Drupal/Core/Entity/ContentEntityDatabaseStorage.php
+++ b/core/lib/Drupal/Core/Entity/ContentEntityDatabaseStorage.php
@@ -11,8 +11,8 @@
 use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Database\Connection;
 use Drupal\Core\Database\Database;
-use Drupal\Core\Entity\Exception\FieldStorageDefinitionUpdateForbiddenException;
 use Drupal\Core\Entity\Query\QueryInterface;
+use Drupal\Core\Entity\Schema\ContentEntitySchemaProviderInterface;
 use Drupal\Core\Entity\Sql\DefaultTableMapping;
 use Drupal\Core\Entity\Sql\SqlEntityStorageInterface;
 use Drupal\Core\Field\FieldDefinitionInterface;
@@ -28,13 +28,12 @@
  *
  * The class uses \Drupal\Core\Entity\Schema\SqlContentEntityStorageSchema
  * internally in order to automatically generate the database schema based on
- * the defined base fields. Entity types can override
- * ContentEntityDatabaseStorage::getSchema() to customize the generated
- * schema; e.g., to add additional indexes.
+ * the defined base fields. Entity types can override the schema handler to
+ * customize the generated schema; e.g., to add additional indexes.
  *
  * @ingroup entity_api
  */
-class ContentEntityDatabaseStorage extends ContentEntityStorageBase implements SqlEntityStorageInterface {
+class ContentEntityDatabaseStorage extends ContentEntityStorageBase implements SqlEntityStorageInterface, EntityTypeListenerInterface, ContentEntitySchemaProviderInterface {
 
   /**
    * The mapping of field columns to SQL tables.
@@ -104,7 +103,7 @@ class ContentEntityDatabaseStorage extends ContentEntityStorageBase implements S
   /**
    * The entity schema handler.
    *
-   * @var \Drupal\Core\Entity\Schema\EntitySchemaHandlerInterface
+   * @var \Drupal\Core\Entity\Schema\ContentEntitySchemaHandlerInterface
    */
   protected $schemaHandler;
 
@@ -152,15 +151,27 @@ public function getFieldStorageDefinitions() {
    */
   public function __construct(EntityTypeInterface $entity_type, Connection $database, EntityManagerInterface $entity_manager, CacheBackendInterface $cache) {
     parent::__construct($entity_type);
-
     $this->database = $database;
     $this->entityManager = $entity_manager;
     $this->cacheBackend = $cache;
+    $this->initTableLayout();
+  }
+
+  /**
+   * Initializes table name variables.
+   */
+  protected function initTableLayout() {
+    // Reset table field values to ensure changes in the entity type definition
+    // are correctly reflected in the table layout.
+    $this->tableMapping = NULL;
+    $this->revisionKey = NULL;
+    $this->revisionTable = NULL;
+    $this->dataTable = NULL;
+    $this->revisionDataTable = NULL;
 
     // @todo Remove table names from the entity type definition in
     //   https://drupal.org/node/2232465
     $this->baseTable = $this->entityType->getBaseTable() ?: $this->entityTypeId;
-
     $revisionable = $this->entityType->isRevisionable();
     if ($revisionable) {
       $this->revisionKey = $this->entityType->getKey('revision') ?: 'revision_id';
@@ -178,6 +189,19 @@ public function __construct(EntityTypeInterface $entity_type, Connection $databa
   }
 
   /**
+   * {@inheritdoc}
+   */
+  public function hasData() {
+    // We cannot use an entity query as it relies on the entity type definition,
+    // which is not available while updating the entity schema.
+    return (bool) $this->database->select($this->baseTable)
+      ->countQuery()
+      ->range(0, 1)
+      ->execute()
+      ->fetchField();
+  }
+
+  /**
    * Returns the base table name.
    *
    * @return string
@@ -218,13 +242,6 @@ public function getRevisionDataTable() {
   }
 
   /**
-   * {@inheritdoc}
-   */
-  public function getSchema() {
-    return $this->schemaHandler()->getSchema();
-  }
-
-  /**
    * Gets the schema handler for this entity storage.
    *
    * @return \Drupal\Core\Entity\Schema\SqlContentEntityStorageSchema
@@ -233,24 +250,44 @@ public function getSchema() {
   protected function schemaHandler() {
     if (!isset($this->schemaHandler)) {
       $schema_handler_class = $this->entityType->getHandlerClass('storage_schema') ?: 'Drupal\Core\Entity\Schema\SqlContentEntityStorageSchema';
-      $this->schemaHandler = new $schema_handler_class($this->entityManager, $this->entityType, $this);
+      $this->schemaHandler = new $schema_handler_class($this->entityManager, $this->entityType, $this, $this->database);
     }
     return $this->schemaHandler;
   }
 
   /**
+   * Updates the wrapped entity type definition.
+   *
+   * @param ContentEntityTypeInterface $entity_type
+   *   The update entity type.
+   *
+   * @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0.
+   *   See https://www.drupal.org/node/2274017.
+   */
+  public function setEntityType(ContentEntityTypeInterface $entity_type) {
+    if ($this->entityType->id() == $entity_type->id()) {
+      $this->entityType = $entity_type;
+      $this->initTableLayout();
+    }
+    else {
+      throw new EntityStorageException(String::format('Unsupported entity type @id', array('@id' => $entity_type->id())));
+    }
+  }
+
+  /**
    * {@inheritdoc}
    */
-  public function getTableMapping() {
-    if (!isset($this->tableMapping)) {
+  public function getTableMapping(array $storage_definitions = NULL) {
+    $table_mapping = $this->tableMapping;
+
+    if (!isset($this->tableMapping) || $storage_definitions) {
+      $definitions = $storage_definitions ?: $this->entityManager->getFieldStorageDefinitions($this->entityTypeId);
+      $base_field_definitions = $this->entityManager->getBaseFieldDefinitions($this->entityTypeId);
+      $table_mapping = new DefaultTableMapping($definitions, $base_field_definitions);
 
-      $definitions = array_filter($this->getFieldStorageDefinitions(), function (FieldStorageDefinitionInterface $definition) {
-        // @todo Remove the check for FieldDefinitionInterface::isMultiple() when
-        //   multiple-value base fields are supported in
-        //   https://drupal.org/node/2248977.
-        return !$definition->hasCustomStorage() && !$definition->isMultiple();
+      $definitions = array_filter($definitions, function (FieldStorageDefinitionInterface $definition) use ($table_mapping) {
+        return $table_mapping->allowsSharedTableStorage($definition);
       });
-      $this->tableMapping = new DefaultTableMapping($definitions);
 
       $key_fields = array_values(array_filter(array($this->idKey, $this->revisionKey, $this->bundleKey, $this->uuidKey, $this->langcodeKey)));
       $all_fields = array_keys($definitions);
@@ -278,16 +315,16 @@ public function getTableMapping() {
       $translatable = $this->entityType->getDataTable() && $this->entityType->isTranslatable();
       if (!$revisionable && !$translatable) {
         // The base layout stores all the base field values in the base table.
-        $this->tableMapping->setFieldNames($this->baseTable, $all_fields);
+        $table_mapping->setFieldNames($this->baseTable, $all_fields);
       }
       elseif ($revisionable && !$translatable) {
         // The revisionable layout stores all the base field values in the base
         // table, except for revision metadata fields. Revisionable fields
         // denormalized in the base table but also stored in the revision table
         // together with the entity ID and the revision ID as identifiers.
-        $this->tableMapping->setFieldNames($this->baseTable, array_diff($all_fields, $revision_metadata_fields));
+        $table_mapping->setFieldNames($this->baseTable, array_diff($all_fields, $revision_metadata_fields));
         $revision_key_fields = array($this->idKey, $this->revisionKey);
-        $this->tableMapping->setFieldNames($this->revisionTable, array_merge($revision_key_fields, $revisionable_fields));
+        $table_mapping->setFieldNames($this->revisionTable, array_merge($revision_key_fields, $revisionable_fields));
       }
       elseif (!$revisionable && $translatable) {
         // Multilingual layouts store key field values in the base table. The
@@ -296,7 +333,7 @@ public function getTableMapping() {
         // denormalized copy of the bundle field value to allow for more
         // performant queries. This means that only the UUID is not stored on
         // the data table.
-        $this->tableMapping
+        $table_mapping
           ->setFieldNames($this->baseTable, $key_fields)
           ->setFieldNames($this->dataTable, array_values(array_diff($all_fields, array($this->uuidKey))))
           // Add the denormalized 'default_langcode' field to the mapping. Its
@@ -312,13 +349,13 @@ public function getTableMapping() {
         // holds the data field values for all non-revisionable fields. The data
         // field values of revisionable fields are denormalized in the data
         // table, as well.
-        $this->tableMapping->setFieldNames($this->baseTable, array_values(array_diff($key_fields, array($this->langcodeKey))));
+        $table_mapping->setFieldNames($this->baseTable, array_values(array_diff($key_fields, array($this->langcodeKey))));
 
         // Like in the multilingual, non-revisionable case the UUID is not
         // in the data table. Additionally, do not store revision metadata
         // fields in the data table.
         $data_fields = array_values(array_diff($all_fields, array($this->uuidKey), $revision_metadata_fields));
-        $this->tableMapping
+        $table_mapping
           ->setFieldNames($this->dataTable, $data_fields)
           // Add the denormalized 'default_langcode' field to the mapping. Its
           // value is identical to the query expression
@@ -327,20 +364,43 @@ public function getTableMapping() {
           ->setExtraColumns($this->dataTable, array('default_langcode'));
 
         $revision_base_fields = array_merge(array($this->idKey, $this->revisionKey, $this->langcodeKey), $revision_metadata_fields);
-        $this->tableMapping->setFieldNames($this->revisionTable, $revision_base_fields);
+        $table_mapping->setFieldNames($this->revisionTable, $revision_base_fields);
 
         $revision_data_key_fields = array($this->idKey, $this->revisionKey, $this->langcodeKey);
-        $revision_data_fields = array_diff($revisionable_fields, $revision_metadata_fields);
-        $this->tableMapping
+        $revision_data_fields = array_diff($revisionable_fields, $revision_metadata_fields, array($this->langcodeKey));
+        $table_mapping
           ->setFieldNames($this->revisionDataTable, array_merge($revision_data_key_fields, $revision_data_fields))
           // Add the denormalized 'default_langcode' field to the mapping. Its
           // value is identical to the query expression
           // "revision_table.langcode = data_table.langcode".
           ->setExtraColumns($this->revisionDataTable, array('default_langcode'));
       }
+
+      // Add dedicated tables.
+      $definitions = array_filter($definitions, function (FieldStorageDefinitionInterface $definition) use ($table_mapping) {
+        return $table_mapping->requiresDedicatedTableStorage($definition);
+      });
+      $extra_columns = array(
+        'bundle',
+        'deleted',
+        'entity_id',
+        'revision_id',
+        'langcode',
+        'delta',
+      );
+      foreach ($definitions as $field_name => $definition) {
+        foreach (array($table_mapping->getDedicatedDataTableName($definition), $table_mapping->getDedicatedRevisionTableName($definition)) as $table_name) {
+          $table_mapping->setFieldNames($table_name, array($field_name));
+          $table_mapping->setExtraColumns($table_name, $extra_columns);
+        }
+      }
+
+      if (!$storage_definitions) {
+        $this->tableMapping = $table_mapping;
+      }
     }
 
-    return $this->tableMapping;
+    return $table_mapping;
   }
 
   /**
@@ -587,7 +647,7 @@ protected function attachPropertyData(array &$entities) {
       $table_mapping = $this->getTableMapping();
       $translations = array();
       if ($this->revisionDataTable) {
-        $data_fields = array_diff_key($table_mapping->getFieldNames($this->revisionDataTable), $table_mapping->getFieldNames($this->baseTable));
+        $data_fields = array_diff($table_mapping->getFieldNames($this->revisionDataTable), $table_mapping->getFieldNames($this->baseTable));
       }
       else {
         $data_fields = $table_mapping->getFieldNames($this->dataTable);
@@ -1156,7 +1216,7 @@ protected function loadFieldItems(array $entities) {
       $definitions[$bundle] = $this->entityManager->getFieldDefinitions($this->entityTypeId, $bundle);
       foreach ($definitions[$bundle] as $field_name => $field_definition) {
         $storage_definition = $field_definition->getFieldStorageDefinition();
-        if ($this->usesDedicatedTable($storage_definition)) {
+        if ($table_mapping->requiresDedicatedTableStorage($storage_definition)) {
           $storage_definitions[$field_name] = $storage_definition;
         }
       }
@@ -1231,7 +1291,7 @@ protected function saveFieldItems(EntityInterface $entity, $update = TRUE) {
 
     foreach ($this->entityManager->getFieldDefinitions($entity_type, $bundle) as $field_name => $field_definition) {
       $storage_definition = $field_definition->getFieldStorageDefinition();
-      if (!$this->usesDedicatedTable($storage_definition)) {
+      if (!$table_mapping->requiresDedicatedTableStorage($storage_definition)) {
         continue;
       }
       $table_name = $table_mapping->getDedicatedDataTableName($storage_definition);
@@ -1246,10 +1306,12 @@ protected function saveFieldItems(EntityInterface $entity, $update = TRUE) {
             ->condition('entity_id', $id)
             ->execute();
         }
-        $this->database->delete($revision_name)
-          ->condition('entity_id', $id)
-          ->condition('revision_id', $vid)
-          ->execute();
+        if ($this->entityType->isRevisionable()) {
+          $this->database->delete($revision_name)
+            ->condition('entity_id', $id)
+            ->condition('revision_id', $vid)
+            ->execute();
+        }
       }
 
       // Prepare the multi-insert query.
@@ -1259,7 +1321,9 @@ protected function saveFieldItems(EntityInterface $entity, $update = TRUE) {
         $columns[] = $table_mapping->getFieldColumnName($storage_definition, $column);
       }
       $query = $this->database->insert($table_name)->fields($columns);
-      $revision_query = $this->database->insert($revision_name)->fields($columns);
+      if ($this->entityType->isRevisionable()) {
+        $revision_query = $this->database->insert($revision_name)->fields($columns);
+      }
 
       $langcodes = $field_definition->isTranslatable() ? $translation_langcodes : array($default_langcode);
       foreach ($langcodes as $langcode) {
@@ -1282,7 +1346,9 @@ protected function saveFieldItems(EntityInterface $entity, $update = TRUE) {
             $record[$column_name] = !empty($attributes['serialize']) ? serialize($item->$column) : $item->$column;
           }
           $query->values($record);
-          $revision_query->values($record);
+          if ($this->entityType->isRevisionable()) {
+            $revision_query->values($record);
+          }
 
           if ($storage_definition->getCardinality() != FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED && ++$delta_count == $storage_definition->getCardinality()) {
             break;
@@ -1297,7 +1363,9 @@ protected function saveFieldItems(EntityInterface $entity, $update = TRUE) {
         if ($entity->isDefaultRevision()) {
           $query->execute();
         }
-        $revision_query->execute();
+        if ($this->entityType->isRevisionable()) {
+          $revision_query->execute();
+        }
       }
     }
   }
@@ -1312,7 +1380,7 @@ protected function deleteFieldItems(EntityInterface $entity) {
     $table_mapping = $this->getTableMapping();
     foreach ($this->entityManager->getFieldDefinitions($entity->getEntityTypeId(), $entity->bundle()) as $field_definition) {
       $storage_definition = $field_definition->getFieldStorageDefinition();
-      if (!$this->usesDedicatedTable($storage_definition)) {
+      if (!$table_mapping->requiresDedicatedTableStorage($storage_definition)) {
         continue;
       }
       $table_name = $table_mapping->getDedicatedDataTableName($storage_definition);
@@ -1320,9 +1388,11 @@ protected function deleteFieldItems(EntityInterface $entity) {
       $this->database->delete($table_name)
         ->condition('entity_id', $entity->id())
         ->execute();
-      $this->database->delete($revision_name)
-        ->condition('entity_id', $entity->id())
-        ->execute();
+      if ($this->entityType->isRevisionable()) {
+        $this->database->delete($revision_name)
+          ->condition('entity_id', $entity->id())
+          ->execute();
+      }
     }
   }
 
@@ -1338,7 +1408,7 @@ protected function deleteFieldItemsRevision(EntityInterface $entity) {
       $table_mapping = $this->getTableMapping();
       foreach ($this->entityManager->getFieldDefinitions($entity->getEntityTypeId(), $entity->bundle()) as $field_definition) {
         $storage_definition = $field_definition->getFieldStorageDefinition();
-        if (!$this->usesDedicatedTable($storage_definition)) {
+        if (!$table_mapping->requiresDedicatedTableStorage($storage_definition)) {
           continue;
         }
         $revision_name = $table_mapping->getDedicatedRevisionTableName($storage_definition);
@@ -1351,114 +1421,80 @@ protected function deleteFieldItemsRevision(EntityInterface $entity) {
   }
 
   /**
-   * Returns whether the field uses a dedicated table for storage.
-   *
-   * @param FieldStorageDefinitionInterface $definition
-   *   The field storage definition.
-   *
-   * @return bool
-   *   Whether the field uses a dedicated table for storage.
+   * {@inheritdoc}
    */
-  protected function usesDedicatedTable(FieldStorageDefinitionInterface $definition) {
-    // Everything that is not provided by the entity type is stored in a
-    // dedicated table.
-    return $definition->getProvider() != $this->entityType->getProvider() && !$definition->hasCustomStorage();
+  public function requiresEntitySchemaChanges(ContentEntityTypeInterface $definition, ContentEntityTypeInterface $original) {
+    return $this->schemaHandler()->requiresEntitySchemaChanges($definition, $original);
   }
 
   /**
    * {@inheritdoc}
    */
-  public function onFieldStorageDefinitionCreate(FieldStorageDefinitionInterface $storage_definition) {
-    $schema = $this->_fieldSqlSchema($storage_definition);
-    foreach ($schema as $name => $table) {
-      $this->database->schema()->createTable($name, $table);
-    }
+  public function requiresFieldSchemaChanges(FieldStorageDefinitionInterface $definition, FieldStorageDefinitionInterface $original) {
+    return $this->schemaHandler()->requiresFieldSchemaChanges($definition, $original);
   }
 
   /**
    * {@inheritdoc}
    */
-  public function onFieldStorageDefinitionUpdate(FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original) {
-    if (!$storage_definition->hasData()) {
-      // There is no data. Re-create the tables completely.
+  public function requiresEntityDataMigration(ContentEntityTypeInterface $definition, ContentEntityTypeInterface $original) {
+    return $this->schemaHandler()->requiresEntityDataMigration($definition, $original);
+  }
 
-      if ($this->database->supportsTransactionalDDL()) {
-        // If the database supports transactional DDL, we can go ahead and rely
-        // on it. If not, we will have to rollback manually if something fails.
-        $transaction = $this->database->startTransaction();
-      }
+  /**
+   * {@inheritdoc}
+   */
+  public function requiresFieldDataMigration(FieldStorageDefinitionInterface $definition, FieldStorageDefinitionInterface $original) {
+    return $this->schemaHandler()->requiresFieldDataMigration($definition, $original);
+  }
 
-      try {
-        $original_schema = $this->_fieldSqlSchema($original);
-        foreach ($original_schema as $name => $table) {
-          $this->database->schema()->dropTable($name, $table);
-        }
-        $schema = $this->_fieldSqlSchema($storage_definition);
-        foreach ($schema as $name => $table) {
-          $this->database->schema()->createTable($name, $table);
-        }
-      }
-      catch (\Exception $e) {
-        if ($this->database->supportsTransactionalDDL()) {
-          $transaction->rollback();
-        }
-        else {
-          // Recreate tables.
-          $original_schema = $this->_fieldSqlSchema($original);
-          foreach ($original_schema as $name => $table) {
-            if (!$this->database->schema()->tableExists($name)) {
-              $this->database->schema()->createTable($name, $table);
-            }
-          }
-        }
-        throw $e;
-      }
-    }
-    else {
-      if ($storage_definition->getColumns() != $original->getColumns()) {
-        throw new FieldStorageDefinitionUpdateForbiddenException("The SQL storage cannot change the schema for an existing field with data.");
-      }
-      // There is data, so there are no column changes. Drop all the prior
-      // indexes and create all the new ones, except for all the priors that
-      // exist unchanged.
-      $table_mapping = $this->getTableMapping();
-      $table = $table_mapping->getDedicatedDataTableName($original);
-      $revision_table = $table_mapping->getDedicatedRevisionTableName($original);
+  /**
+   * {@inheritdoc}
+   */
+  public function onEntityTypeCreate(EntityTypeInterface $entity_type) {
+    $this->schemaHandler()->onEntityTypeCreate($entity_type);
+  }
 
-      $schema = $storage_definition->getSchema();
-      $original_schema = $original->getSchema();
+  /**
+   * {@inheritdoc}
+   */
+  public function onEntityTypeUpdate(EntityTypeInterface $entity_type, EntityTypeInterface $original) {
+    // Ensure we have an updated entity type definition.
+    $this->entityType = $this->entityManager->getDefinition($this->entityTypeId);
+    // The table layout may have changed depending on the new entity type
+    // definition.
+    $this->initTableLayout();
+    // Let the schema handler adapt to possible table layout changes.
+    $this->schemaHandler()->onEntityTypeUpdate($entity_type, $original);
+  }
 
-      foreach ($original_schema['indexes'] as $name => $columns) {
-        if (!isset($schema['indexes'][$name]) || $columns != $schema['indexes'][$name]) {
-          $real_name = static::_fieldIndexName($storage_definition, $name);
-          $this->database->schema()->dropIndex($table, $real_name);
-          $this->database->schema()->dropIndex($revision_table, $real_name);
-        }
-      }
-      $table = $table_mapping->getDedicatedDataTableName($storage_definition);
-      $revision_table = $table_mapping->getDedicatedRevisionTableName($storage_definition);
-      foreach ($schema['indexes'] as $name => $columns) {
-        if (!isset($original_schema['indexes'][$name]) || $columns != $original_schema['indexes'][$name]) {
-          $real_name = static::_fieldIndexName($storage_definition, $name);
-          $real_columns = array();
-          foreach ($columns as $column_name) {
-            // Indexes can be specified as either a column name or an array with
-            // column name and length. Allow for either case.
-            if (is_array($column_name)) {
-              $real_columns[] = array(
-                $table_mapping->getFieldColumnName($storage_definition, $column_name[0]),
-                $column_name[1],
-              );
-            }
-            else {
-              $real_columns[] = $table_mapping->getFieldColumnName($storage_definition, $column_name);
-            }
-          }
-          $this->database->schema()->addIndex($table, $real_name, $real_columns);
-          $this->database->schema()->addIndex($revision_table, $real_name, $real_columns);
-        }
-      }
-    }
+  /**
+   * {@inheritdoc}
+   */
+  public function onEntityTypeDelete(EntityTypeInterface $entity_type) {
+    $this->schemaHandler()->onEntityTypeDelete($entity_type);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function onFieldStorageDefinitionCreate(FieldStorageDefinitionInterface $storage_definition) {
+    // If we are adding a field stored in a shared table we need to recompute
+    // the table mapping.
+    // @todo This does not belong here. Remove it once we are able to generate a
+    //   fresh table mapping in the schema handler. See
+    //   https://www.drupal.org/node/2274017.
+    if ($this->getTableMapping()->allowsSharedTableStorage($storage_definition)) {
+      $this->tableMapping = NULL;
+    }
+    $this->schemaHandler()->onFieldStorageDefinitionCreate($storage_definition);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function onFieldStorageDefinitionUpdate(FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original) {
+    $this->schemaHandler()->onFieldStorageDefinitionUpdate($storage_definition, $original);
   }
 
   /**
@@ -1467,19 +1503,22 @@ public function onFieldStorageDefinitionUpdate(FieldStorageDefinitionInterface $
   public function onFieldStorageDefinitionDelete(FieldStorageDefinitionInterface $storage_definition) {
     $table_mapping = $this->getTableMapping();
 
-    // Mark all data associated with the field for deletion.
-    $table = $table_mapping->getDedicatedDataTableName($storage_definition);
-    $revision_table = $table_mapping->getDedicatedRevisionTableName($storage_definition);
-    $this->database->update($table)
-      ->fields(array('deleted' => 1))
-      ->execute();
+    if ($table_mapping->requiresDedicatedTableStorage($storage_definition)) {
+      // Mark all data associated with the field for deletion.
+      $table = $table_mapping->getDedicatedDataTableName($storage_definition);
+      $revision_table = $table_mapping->getDedicatedRevisionTableName($storage_definition);
+      $this->database->update($table)
+        ->fields(array('deleted' => 1))
+        ->execute();
+      if ($this->entityType->isRevisionable()) {
+        $this->database->update($revision_table)
+          ->fields(array('deleted' => 1))
+          ->execute();
+      }
+    }
 
-    // Move the table to a unique name while the table contents are being
-    // deleted.
-    $new_table = $table_mapping->getDedicatedDataTableName($storage_definition, TRUE);
-    $revision_new_table = $table_mapping->getDedicatedRevisionTableName($storage_definition, TRUE);
-    $this->database->schema()->renameTable($table, $new_table);
-    $this->database->schema()->renameTable($revision_table, $revision_new_table);
+    // Update the field schema.
+    $this->schemaHandler()->onFieldStorageDefinitionDelete($storage_definition);
   }
 
   /**
@@ -1489,16 +1528,20 @@ public function onFieldDefinitionDelete(FieldDefinitionInterface $field_definiti
     $table_mapping = $this->getTableMapping();
     $storage_definition = $field_definition->getFieldStorageDefinition();
     // Mark field data as deleted.
-    $table_name = $table_mapping->getDedicatedDataTableName($storage_definition);
-    $revision_name = $table_mapping->getDedicatedRevisionTableName($storage_definition);
-    $this->database->update($table_name)
-      ->fields(array('deleted' => 1))
-      ->condition('bundle', $field_definition->getBundle())
-      ->execute();
-    $this->database->update($revision_name)
-      ->fields(array('deleted' => 1))
-      ->condition('bundle', $field_definition->getBundle())
-      ->execute();
+    if ($table_mapping->requiresDedicatedTableStorage($storage_definition)) {
+      $table_name = $table_mapping->getDedicatedDataTableName($storage_definition);
+      $revision_name = $table_mapping->getDedicatedRevisionTableName($storage_definition);
+      $this->database->update($table_name)
+        ->fields(array('deleted' => 1))
+        ->condition('bundle', $field_definition->getBundle())
+        ->execute();
+      if ($this->entityType->isRevisionable()) {
+        $this->database->update($revision_name)
+          ->fields(array('deleted' => 1))
+          ->condition('bundle', $field_definition->getBundle())
+          ->execute();
+      }
+    }
   }
 
   /**
@@ -1517,7 +1560,7 @@ public function onBundleRename($bundle, $bundle_new) {
 
     foreach ($field_definitions as $field_definition) {
       $storage_definition = $field_definition->getFieldStorageDefinition();
-      if ($this->usesDedicatedTable($storage_definition)) {
+      if ($table_mapping->requiresDedicatedTableStorage($storage_definition)) {
         $is_deleted = $this->storageDefinitionIsDeleted($storage_definition);
         $table_name = $table_mapping->getDedicatedDataTableName($storage_definition, $is_deleted);
         $revision_name = $table_mapping->getDedicatedRevisionTableName($storage_definition, $is_deleted);
@@ -1525,10 +1568,12 @@ public function onBundleRename($bundle, $bundle_new) {
           ->fields(array('bundle' => $bundle_new))
           ->condition('bundle', $bundle)
           ->execute();
-        $this->database->update($revision_name)
-          ->fields(array('bundle' => $bundle_new))
-          ->condition('bundle', $bundle)
-          ->execute();
+        if ($this->entityType->isRevisionable()) {
+          $this->database->update($revision_name)
+            ->fields(array('bundle' => $bundle_new))
+            ->condition('bundle', $bundle)
+            ->execute();
+        }
       }
     }
   }
@@ -1606,20 +1651,18 @@ protected function purgeFieldItems(ContentEntityInterface $entity, FieldDefiniti
     $this->database->delete($table_name)
       ->condition('revision_id', $revision_id)
       ->execute();
-    $this->database->delete($revision_name)
-      ->condition('revision_id', $revision_id)
-      ->execute();
+    if ($this->entityType->isRevisionable()) {
+      $this->database->delete($revision_name)
+        ->condition('revision_id', $revision_id)
+        ->execute();
+    }
   }
 
   /**
    * {@inheritdoc}
    */
   public function finalizePurge(FieldStorageDefinitionInterface $storage_definition) {
-    $table_mapping = $this->getTableMapping();
-    $table_name = $table_mapping->getDedicatedDataTableName($storage_definition, TRUE);
-    $revision_name = $table_mapping->getDedicatedRevisionTableName($storage_definition, TRUE);
-    $this->database->schema()->dropTable($table_name);
-    $this->database->schema()->dropTable($revision_name);
+    $this->schemaHandler()->finalizePurge($storage_definition);
   }
 
   /**
@@ -1628,230 +1671,66 @@ public function finalizePurge(FieldStorageDefinitionInterface $storage_definitio
   public function countFieldData($storage_definition, $as_bool = FALSE) {
     $table_mapping = $this->getTableMapping();
 
-    $is_deleted = $this->storageDefinitionIsDeleted($storage_definition);
-    $table_name = $table_mapping->getDedicatedDataTableName($storage_definition, $is_deleted);
-    $query = $this->database->select($table_name, 't');
-    $or = $query->orConditionGroup();
-    foreach ($storage_definition->getColumns() as $column_name => $data) {
-      $or->isNotNull($table_mapping->getFieldColumnName($storage_definition, $column_name));
-    }
-    $query
-      ->condition($or)
-      ->fields('t', array('entity_id'))
-      ->distinct(TRUE);
-    // If we are performing the query just to check if the field has data
-    // limit the number of rows.
-    if ($as_bool) {
-      $query->range(0, 1);
-    }
-    $count = $query->countQuery()->execute()->fetchField();
-    return $as_bool ? (bool) $count : (int) $count;
-  }
-
-  /**
-   * Returns whether the passed field has been already deleted.
-   *
-   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition
-   *   The field storage definition.
-   *
-   * @return bool
-   *   Whether the field has been already deleted.
-   */
-  protected function storageDefinitionIsDeleted(FieldStorageDefinitionInterface $storage_definition) {
-    return !array_key_exists($storage_definition->getName(), $this->entityManager->getFieldStorageDefinitions($this->entityTypeId));
-  }
-
-  /**
-   * Gets the SQL table schema.
-   *
-   * @private Calling this function circumvents the entity system and is
-   * strongly discouraged. This function is not considered part of the public
-   * API and modules relying on it might break even in minor releases.
-   *
-   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition
-   *   The field storage definition.
-   * @param array $schema
-   *   The field schema array. Mandatory for upgrades, omit otherwise.
-   * @param bool $deleted
-   *   (optional) Whether the schema of the table holding the values of a
-   *   deleted field should be returned.
-   *
-   * @return array
-   *   The same as a hook_schema() implementation for the data and the
-   *   revision tables.
-   *
-   * @see hook_schema()
-   */
-  public static function _fieldSqlSchema(FieldStorageDefinitionInterface $storage_definition, array $schema = NULL, $deleted = FALSE) {
-    $table_mapping = new DefaultTableMapping(array());
-
-    $description_current = "Data storage for {$storage_definition->getTargetEntityTypeId()} field {$storage_definition->getName()}.";
-    $description_revision = "Revision archive storage for {$storage_definition->getTargetEntityTypeId()} field {$storage_definition->getName()}.";
-
-    $entity_type_id = $storage_definition->getTargetEntityTypeId();
-    $entity_manager = \Drupal::entityManager();
-    $entity_type = $entity_manager->getDefinition($entity_type_id);
-    $definitions = $entity_manager->getBaseFieldDefinitions($entity_type_id);
-
-    // Define the entity ID schema based on the field definitions.
-    $id_definition = $definitions[$entity_type->getKey('id')];
-    if ($id_definition->getType() == 'integer') {
-      $id_schema = array(
-        'type' => 'int',
-        'unsigned' => TRUE,
-        'not null' => TRUE,
-        'description' => 'The entity id this data is attached to',
-      );
-    }
-    else {
-      $id_schema = array(
-        'type' => 'varchar',
-        'length' => 128,
-        'not null' => TRUE,
-        'description' => 'The entity id this data is attached to',
-      );
-    }
-
-    // Define the revision ID schema, default to integer if there is no revision
-    // ID.
-    $revision_id_definition = $entity_type->hasKey('revision') ? $definitions[$entity_type->getKey('revision')] : NULL;
-    if (!$revision_id_definition || $revision_id_definition->getType() == 'integer') {
-      $revision_id_schema = array(
-        'type' => 'int',
-        'unsigned' => TRUE,
-        'not null' => FALSE,
-        'description' => 'The entity revision id this data is attached to, or NULL if the entity type is not versioned',
-      );
+    if ($table_mapping->requiresDedicatedTableStorage($storage_definition)) {
+      $is_deleted = $this->storageDefinitionIsDeleted($storage_definition);
+      $table_name = $table_mapping->getDedicatedDataTableName($storage_definition, $is_deleted);
+      $query = $this->database->select($table_name, 't');
+      $or = $query->orConditionGroup();
+      foreach ($storage_definition->getColumns() as $column_name => $data) {
+        $or->isNotNull($table_mapping->getFieldColumnName($storage_definition, $column_name));
+      }
+      $query
+        ->condition($or)
+        ->fields('t', array('entity_id'))
+        ->distinct(TRUE);
+      // If we are performing the query just to check if the field has data
+      // limit the number of rows.
+      if ($as_bool) {
+        $query->range(0, 1);
+      }
+      $count = $query->countQuery()->execute()->fetchField();
     }
     else {
-      $revision_id_schema = array(
-        'type' => 'varchar',
-        'length' => 128,
-        'not null' => FALSE,
-        'description' => 'The entity revision id this data is attached to, or NULL if the entity type is not versioned',
-      );
-    }
-
-    $current = array(
-      'description' => $description_current,
-      'fields' => array(
-        'bundle' => array(
-          'type' => 'varchar',
-          'length' => 128,
-          'not null' => TRUE,
-          'default' => '',
-          'description' => 'The field instance bundle to which this row belongs, used when deleting a field instance',
-        ),
-        'deleted' => array(
-          'type' => 'int',
-          'size' => 'tiny',
-          'not null' => TRUE,
-          'default' => 0,
-          'description' => 'A boolean indicating whether this data item has been deleted'
-        ),
-        'entity_id' => $id_schema,
-        'revision_id' => $revision_id_schema,
-        'langcode' => array(
-          'type' => 'varchar',
-          'length' => 32,
-          'not null' => TRUE,
-          'default' => '',
-          'description' => 'The language code for this data item.',
-        ),
-        'delta' => array(
-          'type' => 'int',
-          'unsigned' => TRUE,
-          'not null' => TRUE,
-          'description' => 'The sequence number for this data item, used for multi-value fields',
-        ),
-      ),
-      'primary key' => array('entity_id', 'deleted', 'delta', 'langcode'),
-      'indexes' => array(
-        'bundle' => array('bundle'),
-        'deleted' => array('deleted'),
-        'entity_id' => array('entity_id'),
-        'revision_id' => array('revision_id'),
-        'langcode' => array('langcode'),
-      ),
-    );
-
-    if (!$schema) {
-      $schema = $storage_definition->getSchema();
-    }
-
-    // Add field columns.
-    foreach ($schema['columns'] as $column_name => $attributes) {
-      $real_name = $table_mapping->getFieldColumnName($storage_definition, $column_name);
-      $current['fields'][$real_name] = $attributes;
-    }
-
-    // Add unique keys.
-    foreach ($schema['unique keys'] as $unique_key_name => $columns) {
-      $real_name = static::_fieldIndexName($storage_definition, $unique_key_name);
-      foreach ($columns as $column_name) {
-        $current['unique keys'][$real_name][] = $table_mapping->getFieldColumnName($storage_definition, $column_name);
+      if ($as_bool) {
+        $count = $this->hasData();
       }
-    }
-
-    // Add indexes.
-    foreach ($schema['indexes'] as $index_name => $columns) {
-      $real_name = static::_fieldIndexName($storage_definition, $index_name);
-      foreach ($columns as $column_name) {
-        // Indexes can be specified as either a column name or an array with
-        // column name and length. Allow for either case.
-        if (is_array($column_name)) {
-          $current['indexes'][$real_name][] = array(
-            $table_mapping->getFieldColumnName($storage_definition, $column_name[0]),
-            $column_name[1],
-          );
+      else {
+        $data_table = $this->dataTable ?: $this->baseTable;
+        $query = $this->database->select($data_table, 't');
+        $columns = $storage_definition->getColumns();
+        if (count($columns) > 1) {
+          $or = $query->orConditionGroup();
+          foreach ($columns as $column_name => $data) {
+            $or->isNotNull($table_mapping->getFieldColumnName($storage_definition, $column_name));
+          }
+          $query->condition($or);
         }
         else {
-          $current['indexes'][$real_name][] = $table_mapping->getFieldColumnName($storage_definition, $column_name);
+          $query->isNotNull($storage_definition->getName());
         }
+        $count = $query
+          ->fields('t', array($this->idKey))
+          ->distinct(TRUE)
+          ->countQuery()
+          ->execute()
+          ->fetchField();
       }
     }
 
-    // Add foreign keys.
-    foreach ($schema['foreign keys'] as $specifier => $specification) {
-      $real_name = static::_fieldIndexName($storage_definition, $specifier);
-      $current['foreign keys'][$real_name]['table'] = $specification['table'];
-      foreach ($specification['columns'] as $column_name => $referenced) {
-        $sql_storage_column = $table_mapping->getFieldColumnName($storage_definition, $column_name);
-        $current['foreign keys'][$real_name]['columns'][$sql_storage_column] = $referenced;
-      }
-    }
-
-    // Construct the revision table.
-    $revision = $current;
-    $revision['description'] = $description_revision;
-    $revision['primary key'] = array('entity_id', 'revision_id', 'deleted', 'delta', 'langcode');
-    $revision['fields']['revision_id']['not null'] = TRUE;
-    $revision['fields']['revision_id']['description'] = 'The entity revision id this data is attached to';
-
-    return array(
-      $table_mapping->getDedicatedDataTableName($storage_definition) => $current,
-      $table_mapping->getDedicatedRevisionTableName($storage_definition) => $revision,
-    );
+    return $as_bool ? (bool) $count : (int) $count;
   }
 
   /**
-   * Generates an index name for a field data table.
-   *
-   * @private Calling this function circumvents the entity system and is
-   * strongly discouraged. This function is not considered part of the public
-   * API and modules relying on it might break even in minor releases.
+   * Returns whether the passed field has been already deleted.
    *
    * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition
    *   The field storage definition.
-   * @param string $index
-   *   The name of the index.
    *
-   * @return string
-   *   A string containing a generated index name for a field data table that is
-   *   unique among all other fields.
+   * @return bool
+   *   Whether the field has been already deleted.
    */
-  public static function _fieldIndexName(FieldStorageDefinitionInterface $storage_definition, $index) {
-    return $storage_definition->getName() . '_' . $index;
+  protected function storageDefinitionIsDeleted(FieldStorageDefinitionInterface $storage_definition) {
+    return !array_key_exists($storage_definition->getName(), $this->entityManager->getFieldStorageDefinitions($this->entityTypeId));
   }
 
 }
diff --git a/core/lib/Drupal/Core/Entity/ContentEntityNullStorage.php b/core/lib/Drupal/Core/Entity/ContentEntityNullStorage.php
index 12aeca3..5460436 100644
--- a/core/lib/Drupal/Core/Entity/ContentEntityNullStorage.php
+++ b/core/lib/Drupal/Core/Entity/ContentEntityNullStorage.php
@@ -20,6 +20,20 @@ class ContentEntityNullStorage extends ContentEntityStorageBase {
   /**
    * {@inheritdoc}
    */
+  public function hasData() {
+    return FALSE;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function countFieldData($storage_definition, $as_bool = FALSE) {
+    return $as_bool ? FALSE : 0;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
   public function loadMultiple(array $ids = NULL) {
     return array();
   }
@@ -131,11 +145,4 @@ protected function doSave($id, EntityInterface $entity) {
   protected function has($id, EntityInterface $entity) {
   }
 
-  /**
-   * {@inheritdoc}
-   */
-  public function countFieldData($storage_definition, $as_bool = FALSE) {
-    return $as_bool ? FALSE : 0;
-  }
-
 }
diff --git a/core/lib/Drupal/Core/Entity/EntityManager.php b/core/lib/Drupal/Core/Entity/EntityManager.php
index 26eac4e..c8bad96 100644
--- a/core/lib/Drupal/Core/Entity/EntityManager.php
+++ b/core/lib/Drupal/Core/Entity/EntityManager.php
@@ -17,6 +17,8 @@
 use Drupal\Core\Entity\Exception\AmbiguousEntityClassException;
 use Drupal\Core\Entity\Exception\NoCorrespondingEntityClassException;
 use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\Field\FieldStorageDefinitionInterface;
+use Drupal\Core\Field\FieldStorageDefinitionListenerInterface;
 use Drupal\Core\Language\LanguageManagerInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Core\Plugin\DefaultPluginManager;
@@ -958,6 +960,78 @@ public function getEntityTypeFromClass($class_name) {
   }
 
   /**
+   * {@inheritdoc}
+   */
+  public function onEntityTypeCreate(EntityTypeInterface $entity_type) {
+    // @todo Forward this to all interested handlers, not only storage, once
+    //   iterating handlers is possible: https://www.drupal.org/node/2332857.
+    $storage = $this->getStorage($entity_type->id());
+    if ($storage instanceof EntityTypeListenerInterface) {
+      $storage->onEntityTypeCreate($entity_type);
+    }
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function onEntityTypeUpdate(EntityTypeInterface $entity_type, EntityTypeInterface $original) {
+    // @todo Forward this to all interested handlers, not only storage, once
+    //   iterating handlers is possible: https://www.drupal.org/node/2332857.
+    $storage = $this->getStorage($entity_type->id());
+    if ($storage instanceof EntityTypeListenerInterface) {
+      $storage->onEntityTypeUpdate($entity_type, $original);
+    }
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function onEntityTypeDelete(EntityTypeInterface $entity_type) {
+    // @todo Forward this to all interested handlers, not only storage, once
+    //   iterating handlers is possible: https://www.drupal.org/node/2332857.
+    $storage = $this->getStorage($entity_type->id());
+    if ($storage instanceof EntityTypeListenerInterface) {
+      $storage->onEntityTypeDelete($entity_type);
+    }
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function onFieldStorageDefinitionCreate(FieldStorageDefinitionInterface $storage_definition) {
+    // @todo Forward this to all interested handlers, not only storage, once
+    //   iterating handlers is possible: https://www.drupal.org/node/2332857.
+    $storage = $this->getStorage($storage_definition->getTargetEntityTypeId());
+    if ($storage instanceof FieldStorageDefinitionListenerInterface) {
+      $storage->onFieldStorageDefinitionCreate($storage_definition);
+    }
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function onFieldStorageDefinitionUpdate(FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original) {
+    // @todo Forward this to all interested handlers, not only storage, once
+    //   iterating handlers is possible: https://www.drupal.org/node/2332857.
+    $storage = $this->getStorage($storage_definition->getTargetEntityTypeId());
+    if ($storage instanceof FieldStorageDefinitionListenerInterface) {
+      $storage->onFieldStorageDefinitionUpdate($storage_definition, $original);
+    }
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function onFieldStorageDefinitionDelete(FieldStorageDefinitionInterface $storage_definition) {
+    // @todo Forward this to all interested handlers, not only storage, once
+    //   iterating handlers is possible: https://www.drupal.org/node/2332857.
+    $storage = $this->getStorage($storage_definition->getTargetEntityTypeId());
+    if ($storage instanceof FieldStorageDefinitionListenerInterface) {
+      $storage->onFieldStorageDefinitionDelete($storage_definition);
+    }
+  }
+
+  /**
    * Acts on entity bundle rename.
    *
    * @param string $entity_type_id
diff --git a/core/lib/Drupal/Core/Entity/EntityManagerInterface.php b/core/lib/Drupal/Core/Entity/EntityManagerInterface.php
index 5bf03cc..66456bf 100644
--- a/core/lib/Drupal/Core/Entity/EntityManagerInterface.php
+++ b/core/lib/Drupal/Core/Entity/EntityManagerInterface.php
@@ -8,11 +8,12 @@
 namespace Drupal\Core\Entity;
 
 use Drupal\Component\Plugin\PluginManagerInterface;
+use Drupal\Core\Field\FieldStorageDefinitionListenerInterface;
 
 /**
  * Provides an interface for entity type managers.
  */
-interface EntityManagerInterface extends PluginManagerInterface {
+interface EntityManagerInterface extends PluginManagerInterface, EntityTypeListenerInterface, FieldStorageDefinitionListenerInterface {
 
   /**
    * Builds a list of entity type labels suitable for a Form API options list.
diff --git a/core/lib/Drupal/Core/Entity/EntityStorageBase.php b/core/lib/Drupal/Core/Entity/EntityStorageBase.php
index b181bb4..cca590d 100644
--- a/core/lib/Drupal/Core/Entity/EntityStorageBase.php
+++ b/core/lib/Drupal/Core/Entity/EntityStorageBase.php
@@ -97,6 +97,16 @@ public function getEntityType() {
   /**
    * {@inheritdoc}
    */
+  public function hasData() {
+    return (bool) $this->getQuery()
+      ->range(0, 1)
+      ->count()
+      ->execute();
+  }
+
+  /**
+   * {@inheritdoc}
+   */
   public function loadUnchanged($id) {
     $this->resetCache(array($id));
     return $this->load($id);
diff --git a/core/lib/Drupal/Core/Entity/EntityStorageInterface.php b/core/lib/Drupal/Core/Entity/EntityStorageInterface.php
index 32867f4..5268505 100644
--- a/core/lib/Drupal/Core/Entity/EntityStorageInterface.php
+++ b/core/lib/Drupal/Core/Entity/EntityStorageInterface.php
@@ -31,6 +31,14 @@
   const FIELD_LOAD_REVISION = 'FIELD_LOAD_REVISION';
 
   /**
+   * Checks whether the storage contains at least one entity.
+   *
+   * @return bool
+   *   TRUE if the storage has data, FALSE otherwise.
+   */
+  public function hasData();
+
+  /**
    * Resets the internal, static entity cache.
    *
    * @param $ids
diff --git a/core/lib/Drupal/Core/Entity/EntityTypeListenerInterface.php b/core/lib/Drupal/Core/Entity/EntityTypeListenerInterface.php
new file mode 100644
index 0000000..c42667c
--- /dev/null
+++ b/core/lib/Drupal/Core/Entity/EntityTypeListenerInterface.php
@@ -0,0 +1,43 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\Entity\EntityTypeListenerInterface.
+ */
+
+namespace Drupal\Core\Entity;
+
+/**
+ * Defines an interface for reacting to entity type creation, deletion, and updates.
+ *
+ * @todo Convert to Symfony events: https://www.drupal.org/node/2332935
+ */
+interface EntityTypeListenerInterface {
+
+  /**
+   * Reacts to the creation of the entity type.
+   *
+   * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
+   *   The entity type being created.
+   */
+  public function onEntityTypeCreate(EntityTypeInterface $entity_type);
+
+  /**
+   * Reacts to the update of the entity type.
+   *
+   * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
+   *   The updated entity type definition.
+   * @param \Drupal\Core\Entity\EntityTypeInterface $original
+   *   The original entity type definition.
+   */
+  public function onEntityTypeUpdate(EntityTypeInterface $entity_type, EntityTypeInterface $original);
+
+  /**
+   * Reacts to the deletion of the entity type.
+   *
+   * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
+   *   The entity type being deleted.
+   */
+  public function onEntityTypeDelete(EntityTypeInterface $entity_type);
+
+}
diff --git a/core/lib/Drupal/Core/Entity/Exception/FieldStorageDefinitionUpdateForbiddenException.php b/core/lib/Drupal/Core/Entity/Exception/FieldStorageDefinitionUpdateForbiddenException.php
index 54e2bff..0149ec3 100644
--- a/core/lib/Drupal/Core/Entity/Exception/FieldStorageDefinitionUpdateForbiddenException.php
+++ b/core/lib/Drupal/Core/Entity/Exception/FieldStorageDefinitionUpdateForbiddenException.php
@@ -7,7 +7,10 @@
 
 namespace Drupal\Core\Entity\Exception;
 
+use Drupal\Core\Entity\EntityStorageException;
+
 /**
  * Exception thrown when a storage definition update is forbidden.
  */
-class FieldStorageDefinitionUpdateForbiddenException extends \Exception { }
+class FieldStorageDefinitionUpdateForbiddenException extends EntityStorageException {
+}
diff --git a/core/lib/Drupal/Core/Entity/FieldableEntityStorageInterface.php b/core/lib/Drupal/Core/Entity/FieldableEntityStorageInterface.php
index 2d695c3..aaab687 100644
--- a/core/lib/Drupal/Core/Entity/FieldableEntityStorageInterface.php
+++ b/core/lib/Drupal/Core/Entity/FieldableEntityStorageInterface.php
@@ -9,42 +9,9 @@
 
 use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
+use Drupal\Core\Field\FieldStorageDefinitionListenerInterface;
 
-interface FieldableEntityStorageInterface extends EntityStorageInterface {
-
-  /**
-   * Reacts to the creation of a field storage definition.
-   *
-   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition
-   *   The definition being created.
-   */
-  public function onFieldStorageDefinitionCreate(FieldStorageDefinitionInterface $storage_definition);
-
-  /**
-   * Reacts to the update of a field storage definition.
-   *
-   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition
-   *   The field being updated.
-   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $original
-   *   The original storage definition; i.e., the definition before the update.
-   *
-   * @throws \Drupal\Core\Entity\Exception\FieldStorageDefinitionUpdateForbiddenException
-   *   Thrown when the update to the field is forbidden.
-   */
-  public function onFieldStorageDefinitionUpdate(FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original);
-
-  /**
-   * Reacts to the deletion of a field storage definition.
-   *
-   * Stored values should not be wiped at once, but marked as 'deleted' so that
-   * they can go through a proper purge process later on.
-   *
-   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition
-   *   The field being deleted.
-   *
-   * @see purgeFieldData()
-   */
-  public function onFieldStorageDefinitionDelete(FieldStorageDefinitionInterface $storage_definition);
+interface FieldableEntityStorageInterface extends EntityStorageInterface, FieldStorageDefinitionListenerInterface {
 
   /**
    * Reacts to the creation of a field.
@@ -59,7 +26,7 @@ public function onFieldDefinitionCreate(FieldDefinitionInterface $field_definiti
    *
    * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
    *   The field definition being updated.
-   * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
+   * @param \Drupal\Core\Field\FieldDefinitionInterface $original
    *   The original field definition; i.e., the definition before the update.
    */
   public function onFieldDefinitionUpdate(FieldDefinitionInterface $field_definition, FieldDefinitionInterface $original);
diff --git a/core/lib/Drupal/Core/Entity/Schema/ContentEntitySchemaHandlerInterface.php b/core/lib/Drupal/Core/Entity/Schema/ContentEntitySchemaHandlerInterface.php
new file mode 100644
index 0000000..43b1d97
--- /dev/null
+++ b/core/lib/Drupal/Core/Entity/Schema/ContentEntitySchemaHandlerInterface.php
@@ -0,0 +1,25 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\Entity\Schema\ContentEntitySchemaHandlerInterface.
+ */
+
+namespace Drupal\Core\Entity\Schema;
+use Drupal\Core\Field\FieldStorageDefinitionInterface;
+use Drupal\Core\Field\FieldStorageDefinitionListenerInterface;
+
+/**
+ * Defines an interface for handling the storage schema of content entities.
+ */
+interface ContentEntitySchemaHandlerInterface extends EntitySchemaHandlerInterface, FieldStorageDefinitionListenerInterface {
+
+  /**
+   * Performs final cleanup after all data of a field has been purged.
+   *
+   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition
+   *   The field being purged.
+   */
+  public function finalizePurge(FieldStorageDefinitionInterface $storage_definition);
+
+}
diff --git a/core/lib/Drupal/Core/Entity/Schema/ContentEntitySchemaManager.php b/core/lib/Drupal/Core/Entity/Schema/ContentEntitySchemaManager.php
new file mode 100644
index 0000000..66f88c1
--- /dev/null
+++ b/core/lib/Drupal/Core/Entity/Schema/ContentEntitySchemaManager.php
@@ -0,0 +1,361 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\Entity\Schema\ContentEntitySchemaManager.
+ */
+
+namespace Drupal\Core\Entity\Schema;
+
+use Drupal\Component\Utility\String;
+use Drupal\Core\Database\DatabaseExceptionWrapper;
+use Drupal\Core\Entity\ContentEntityTypeInterface;
+use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Entity\EntityStorageException;
+use Drupal\Core\Entity\EntityTypeInterface;
+use Drupal\Core\Field\FieldStorageDefinitionInterface;
+use Drupal\Core\State\StateInterface;
+use Drupal\Core\StringTranslation\StringTranslationTrait;
+
+/**
+ * Manages changes in the entity and field schema.
+ */
+class ContentEntitySchemaManager implements EntitySchemaManagerInterface {
+  use StringTranslationTrait;
+
+  /**
+   * The entity manager service.
+   *
+   * @var \Drupal\Core\Entity\EntityManagerInterface
+   */
+  protected $entityManager;
+
+  /**
+   * The state service.
+   *
+   * @var \Drupal\Core\State\StateInterface
+   */
+  protected $state;
+
+  /**
+   * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
+   * @param StateInterface $state
+   */
+  public function __construct(EntityManagerInterface $entity_manager, StateInterface $state) {
+    $this->entityManager = $entity_manager;
+    $this->state = $state;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function onEntityTypeCreate(EntityTypeInterface $entity_type) {
+    // Store the current definitions to be able to track changes.
+    $this->saveEntityTypeDefinition($entity_type);
+    if ($entity_type->isFieldable()) {
+      $entity_type_id = $entity_type->id();
+      $this->saveFieldStorageDefinitions($entity_type_id, $this->entityManager->getFieldStorageDefinitions($entity_type_id));
+    }
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function onEntityTypeUpdate(EntityTypeInterface $entity_type, EntityTypeInterface $original) {
+    // Store the current definitions to be able to track changes.
+    $this->saveEntityTypeDefinition($entity_type);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function onEntityTypeDelete(EntityTypeInterface $entity_type) {
+    $entity_type_id = $entity_type->id();
+    $this->deleteEntityTypeDefinition($entity_type_id);
+    // Ensure we delete any data concerning this entity type. It might have
+    // switched from fieldable to non-fieldable during its life cycle.
+    $this->deleteFieldStorageDefinitions($entity_type_id);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function onFieldStorageDefinitionCreate(FieldStorageDefinitionInterface $storage_definition) {
+    $entity_type_id = $storage_definition->getTargetEntityTypeId();
+    // Update our field storage definitions.
+    $definitions = $this->loadFieldStorageDefinitions($entity_type_id);
+    $definitions[$storage_definition->getName()] = $storage_definition;
+    $this->saveFieldStorageDefinitions($entity_type_id, $definitions);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function onFieldStorageDefinitionUpdate(FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original) {
+    $entity_type_id = $storage_definition->getTargetEntityTypeId();
+    // Update our field storage definitions.
+    $definitions = $this->loadFieldStorageDefinitions($entity_type_id);
+    $definitions[$storage_definition->getName()] = $storage_definition;
+    $this->saveFieldStorageDefinitions($entity_type_id, $definitions);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function onFieldStorageDefinitionDelete(FieldStorageDefinitionInterface $storage_definition) {
+    $entity_type_id = $storage_definition->getTargetEntityTypeId();
+    // Update our field storage definitions.
+    $definitions = $this->loadFieldStorageDefinitions($entity_type_id);
+    unset($definitions[$storage_definition->getName()]);
+    $this->saveFieldStorageDefinitions($entity_type_id, $definitions);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getChangeList($entity_type_id = NULL) {
+    $change_list = array();
+    $definitions = array_filter($this->entityManager->getDefinitions(), function($definition) { return $definition instanceof ContentEntityTypeInterface; });
+    $entity_type_ids = isset($entity_type_id) ? array($entity_type_id) : array_keys($definitions);
+
+    foreach ($entity_type_ids as $entity_type_id) {
+      $definition = $definitions[$entity_type_id];
+      $storage = $this->entityManager->getStorage($entity_type_id);
+
+      if ($definition instanceof ContentEntityTypeInterface && $storage instanceof ContentEntitySchemaProviderInterface) {
+        // Check whether there are changes in the entity type definition that
+        // would affect entity schema.
+        $original = $this->loadEntityTypeDefinition($entity_type_id);
+        if ($storage->requiresEntitySchemaChanges($definition, $original)) {
+          $change_list[$entity_type_id]['entity_type'] = static::DEFINITION_UPDATED;
+          if ($storage->requiresEntityDataMigration($definition, $original)) {
+            $change_list[$entity_type_id]['data_migration'] = TRUE;
+          }
+        }
+
+        // Check whether there are changes in the field storage definitions that
+        // would affect entity schema. We skip definitions with custom storage
+        // as they do not affect entity schema.
+        if ($definition->isFieldable()) {
+          $field_changes = array();
+          $original_storage_definitions = $this->loadFieldStorageDefinitions($entity_type_id);
+          $storage_definitions = $this->entityManager->getFieldStorageDefinitions($entity_type_id);
+
+          // Detect created field storage definitions.
+          $created = array_filter(array_diff_key($storage_definitions, $original_storage_definitions), function(FieldStorageDefinitionInterface $definition) { return !$definition->hasCustomStorage(); });
+          $field_changes = array_merge($field_changes, array_map(function() { return static::DEFINITION_CREATED; }, $created));
+
+          // Detect deleted field storage definitions.
+          $deleted = array_filter(array_diff_key($original_storage_definitions, $storage_definitions), function(FieldStorageDefinitionInterface $definition) { return !$definition->hasCustomStorage(); });
+          $field_changes = array_merge($field_changes, array_map(function() { return static::DEFINITION_DELETED; }, $deleted));
+
+          // Now compare field storage definitions.
+          foreach (array_intersect_key($storage_definitions, $original_storage_definitions) as $field_name => $definition) {
+            /** @var \Drupal\Core\Field\FieldStorageDefinitionInterface $definition */
+            if (!$definition->hasCustomStorage()) {
+              $original = $this->loadFieldStorageDefinitions($definition->getTargetEntityTypeId())[$definition->getName()];
+              if ($storage->requiresFieldSchemaChanges($original, $definition)) {
+                $field_changes[$field_name] = static::DEFINITION_UPDATED;
+                if ($storage->requiresFieldDataMigration($original, $definition)) {
+                  $change_list[$entity_type_id]['data_migration'] = TRUE;
+                }
+              }
+            }
+          }
+
+          if ($field_changes) {
+            $change_list[$entity_type_id]['field_storage_definitions'] = $field_changes;
+          }
+        }
+      }
+    }
+
+    return array_filter($change_list);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function applyChanges($entity_type_id = NULL) {
+    foreach ($this->getChangeList($entity_type_id) as $entity_type_id => $change_list) {
+      try {
+        $has_data = $this->entityManager->getStorage($entity_type_id)->hasData();
+      }
+      catch (DatabaseExceptionWrapper $e) {
+        // The entity schema might be corrupted. In this case it is safer to
+        // assume there is data available, to avoid performing unrecoverable
+        // operations.
+        $has_data = TRUE;
+      }
+
+      // We do not allow any kind of schema change that would imply a data
+      // migration.
+      if (empty($change_list['data_migration']) || !$has_data) {
+        // Process entity type definition changes.
+        if (!empty($change_list['entity_type']) && $change_list['entity_type'] == static::DEFINITION_UPDATED) {
+          $entity_type = $this->entityManager->getDefinition($entity_type_id);
+          $this->entityManager->onEntityTypeUpdate($entity_type, $this->loadEntityTypeDefinition($entity_type_id));
+        }
+
+        // Process field storage definition changes.
+        if (!empty($change_list['field_storage_definitions'])) {
+          $storage_definitions = $this->entityManager->getFieldStorageDefinitions($entity_type_id);
+          $original_storage_definitions = $this->loadFieldStorageDefinitions($entity_type_id);
+
+          foreach ($change_list['field_storage_definitions'] as $field_name => $change) {
+            switch ($change) {
+              case static::DEFINITION_CREATED:
+                $this->entityManager->onFieldStorageDefinitionCreate($storage_definitions[$field_name]);
+                break;
+
+              case static::DEFINITION_UPDATED:
+                $this->entityManager->onFieldStorageDefinitionUpdate($storage_definitions[$field_name], $original_storage_definitions[$field_name]);
+                break;
+
+              case static::DEFINITION_DELETED:
+                $this->entityManager->onFieldStorageDefinitionDelete($storage_definitions[$field_name]);
+                break;
+            }
+          }
+        }
+      }
+      else {
+        $args = array('@entity_type_id' => $entity_type_id);
+        $message = String::format('Changes for the @entity_type_id entity type involve a data migration and cannot be applied.', $args);
+        throw new EntityStorageException($message);
+      }
+    }
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getChangeSummary($entity_type_id = NULL) {
+    $summary = array();
+
+    foreach ($this->getChangeList($entity_type_id) as $entity_type_id => $change_list) {
+      // Process entity type definition changes.
+      if (!empty($change_list['entity_type']) && $change_list['entity_type'] == static::DEFINITION_UPDATED) {
+        $definition = $this->entityManager->getDefinition($entity_type_id);
+        $summary[$entity_type_id][] = $this->t('The %entity_type entity type has schema changes.', array('%entity_type' => $definition->getLabel()));
+      }
+
+      // Process field storage definition changes.
+      if (!empty($change_list['field_storage_definitions'])) {
+        $storage_definitions = $this->entityManager->getFieldStorageDefinitions($entity_type_id);
+        $original_storage_definitions = $this->loadFieldStorageDefinitions($entity_type_id);
+
+        foreach ($change_list['field_storage_definitions'] as $field_name => $change) {
+          $definition = isset($storage_definitions[$field_name]) ? $storage_definitions[$field_name] : $original_storage_definitions[$field_name];
+          $args = array('%field_name' => $definition->getLabel());
+
+          switch ($change) {
+            case static::DEFINITION_CREATED:
+              $summary[$entity_type_id][] = $this->t('The %field_name field has been created.', $args);
+              break;
+
+            case static::DEFINITION_UPDATED:
+              $summary[$entity_type_id][] = $this->t('The %field_name field has schema changes.', $args);
+              break;
+
+            case static::DEFINITION_DELETED:
+              $summary[$entity_type_id][] = $this->t('The %field_name field has been deleted.', $args);
+              break;
+          }
+        }
+      }
+    }
+
+    return $summary;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getSystemRequirements($phase) {
+    $requirements = array(
+      'title' => t('Entity schema'),
+    );
+
+    if ($this->getChangeList()) {
+      $requirements['value'] = $this->t('Out of date');
+      $requirements['severity'] = REQUIREMENT_ERROR;
+      $requirements['description'] = $requirements['update']['description'] = $this->t('Some entity types have schema updates to install. You should run the <a href="@update">database update script</a> immediately.', array('@update' => base_path() . 'update.php'));
+    }
+    else {
+      $requirements['value'] = $this->t('Up to date');
+    }
+
+    return $requirements;
+  }
+
+  /**
+   * Returns the specified stored entity type definition.
+   *
+   * @param string $entity_type_id
+   *   The entity type identifier.
+   *
+   * @return \Drupal\Core\Entity\ContentEntityTypeInterface
+   *   A stored entity type definition.
+   */
+  protected function loadEntityTypeDefinition($entity_type_id) {
+    return $this->state->get('entity.schema.manager.' . $entity_type_id . '.entity_type');
+  }
+
+  /**
+   * Stores the specified stored entity type definition.
+   *
+   * @param \Drupal\Core\Entity\ContentEntityTypeInterface $definition
+   *   The entity type definition.
+   */
+  protected function saveEntityTypeDefinition(ContentEntityTypeInterface $definition) {
+    $entity_type_id = $definition->id();
+    $this->state->set('entity.schema.manager.' . $entity_type_id . '.entity_type', $definition);
+  }
+
+  /**
+   * Deletes the specified stored entity type.
+   *
+   * @param string $entity_type_id
+   *   The entity type definition identifier.
+   */
+  protected function deleteEntityTypeDefinition($entity_type_id) {
+    $this->state->delete('entity.schema.manager.' . $entity_type_id . '.entity_type');
+  }
+
+  /**
+   * Returns the stored field storage definitions for the specified entity type.
+   *
+   * @param string $entity_type_id
+   *   The entity type identifier.
+   *
+   * @return \Drupal\Core\Field\FieldStorageDefinitionInterface[]
+   *   An array of field storage definitions.
+   */
+  protected function loadFieldStorageDefinitions($entity_type_id) {
+    return $this->state->get('entity.schema.manager.' . $entity_type_id . '.field_storage_definitions');
+  }
+
+  /**
+   * Stores the field storage definitions for the specified entity type.
+   *
+   * @param string $entity_type_id
+   *   The entity type identifier.
+   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface[] $storage_definitions
+   *   An array of field storage definitions.
+   */
+  protected function saveFieldStorageDefinitions($entity_type_id, array $storage_definitions) {
+    $this->state->set('entity.schema.manager.' . $entity_type_id . '.field_storage_definitions', $storage_definitions);
+  }
+
+  /**
+   * Deletes the stored field storage definitions for the specified entity type.
+   *
+   * @param string $entity_type_id
+   *   The entity type definition identifier.
+   */
+  protected function deleteFieldStorageDefinitions($entity_type_id) {
+    $this->state->delete('entity.schema.manager.' . $entity_type_id . '.field_storage_definitions');
+  }
+
+}
diff --git a/core/lib/Drupal/Core/Entity/Schema/ContentEntitySchemaProviderInterface.php b/core/lib/Drupal/Core/Entity/Schema/ContentEntitySchemaProviderInterface.php
new file mode 100644
index 0000000..d1df87d
--- /dev/null
+++ b/core/lib/Drupal/Core/Entity/Schema/ContentEntitySchemaProviderInterface.php
@@ -0,0 +1,71 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\Entity\Schema\ContentEntitySchemaProviderInterface.
+ */
+
+namespace Drupal\Core\Entity\Schema;
+
+use Drupal\Core\Entity\ContentEntityTypeInterface;
+use Drupal\Core\Field\FieldStorageDefinitionInterface;
+
+/**
+ * Provides a common interface for a storage classes providing entity schema.
+ */
+interface ContentEntitySchemaProviderInterface {
+
+  /**
+   * Checks whether the definition changes imply entity schema changes.
+   *
+   * @param \Drupal\Core\Entity\ContentEntityTypeInterface $definition
+   *   The updated entity type definition.
+   * @param \Drupal\Core\Entity\ContentEntityTypeInterface $original
+   *   The original entity type definition.
+   *
+   * @return bool
+   *   TRUE if the changes imply entity schema changes, FALSE otherwise.
+   */
+  public function requiresEntitySchemaChanges(ContentEntityTypeInterface $definition, ContentEntityTypeInterface $original);
+
+  /**
+   * Checks whether the definition changes imply field schema changes.
+   *
+   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $definition
+   *   The updated field storage definition.
+   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $original
+   *   The original field storage definition.
+   *
+   * @return bool
+   *   TRUE if the changes imply field schema changes, FALSE otherwise.
+   */
+  public function requiresFieldSchemaChanges(FieldStorageDefinitionInterface $definition, FieldStorageDefinitionInterface $original);
+
+  /**
+   * Checks whether the entity type definition changes imply a data migration.
+   *
+   * @param \Drupal\Core\Entity\ContentEntityTypeInterface $definition
+   *   The updated entity type definition.
+   * @param \Drupal\Core\Entity\ContentEntityTypeInterface $original
+   *   The original entity type definition.
+   *
+   * @return bool
+   *   TRUE if the changes imply a data migration, FALSE otherwise.
+   */
+  public function requiresEntityDataMigration(ContentEntityTypeInterface $definition, ContentEntityTypeInterface $original);
+
+
+  /**
+   * Checks whether the field storage definition changes imply a data migration.
+   *
+   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $definition
+   *   The updated field storage definition.
+   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $original
+   *   The original field storage definition.
+   *
+   * @return bool
+   *   TRUE if the changes imply a data migration, FALSE otherwise.
+   */
+  public function requiresFieldDataMigration(FieldStorageDefinitionInterface $definition, FieldStorageDefinitionInterface $original);
+
+}
diff --git a/core/lib/Drupal/Core/Entity/Schema/EntitySchemaHandlerInterface.php b/core/lib/Drupal/Core/Entity/Schema/EntitySchemaHandlerInterface.php
index a38b82c..51001bd 100644
--- a/core/lib/Drupal/Core/Entity/Schema/EntitySchemaHandlerInterface.php
+++ b/core/lib/Drupal/Core/Entity/Schema/EntitySchemaHandlerInterface.php
@@ -6,9 +6,10 @@
  */
 
 namespace Drupal\Core\Entity\Schema;
+use Drupal\Core\Entity\EntityTypeListenerInterface;
 
 /**
  * Defines an interface for handling the storage schema of entities.
  */
-interface EntitySchemaHandlerInterface extends EntitySchemaProviderInterface {
+interface EntitySchemaHandlerInterface extends EntityTypeListenerInterface {
 }
diff --git a/core/lib/Drupal/Core/Entity/Schema/EntitySchemaManagerInterface.php b/core/lib/Drupal/Core/Entity/Schema/EntitySchemaManagerInterface.php
new file mode 100644
index 0000000..84116be
--- /dev/null
+++ b/core/lib/Drupal/Core/Entity/Schema/EntitySchemaManagerInterface.php
@@ -0,0 +1,99 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\Entity\Schema\EntitySchemaManagerInterface.
+ */
+
+namespace Drupal\Core\Entity\Schema;
+
+use Drupal\Core\Entity\EntityTypeListenerInterface;
+use Drupal\Core\Field\FieldStorageDefinitionListenerInterface;
+
+/**
+ * Defines an interface for managing changes in the entity and field schema.
+ */
+interface EntitySchemaManagerInterface extends EntityTypeListenerInterface, FieldStorageDefinitionListenerInterface {
+
+  /**
+   * Indicates that a definition has just been created.
+   *
+   * @var int
+   */
+  const DEFINITION_CREATED = 1;
+
+  /**
+   * Indicates that a definition has changes.
+   *
+   * @var int
+   */
+  const DEFINITION_UPDATED = 2;
+
+  /**
+   * Indicates that a definition has just been deleted.
+   *
+   * @var int
+   */
+  const DEFINITION_DELETED = 3;
+
+  /**
+   * Returns a list of changes to entity type and field storage definitions.
+   *
+   * @param string $entity_type_id
+   *   (optional) The identifier of the entity type to be checked for changes.
+   *   Defaults to all the available entity types.
+   *
+   * @return array
+   *   An associative array keyed by entity type id of change descriptors. Every
+   *   entry is an associative array with the following optional keys:
+   *   - entity_type: a scalar having only the DEFINITION_UPDATED value.
+   *   - field_storage_definitions: an associative array keyed by field name of
+   *     scalars having one value among:
+   *     - DEFINITION_CREATED
+   *     - DEFINITION_UPDATED
+   *     - DEFINITION_DELETED
+   *   - data_migration: boolean indicating whether the changes imply a data
+   *     migration.
+   */
+  public function getChangeList($entity_type_id = NULL);
+
+  /**
+   * Applies all the detected valid changes.
+   *
+   * Only changes that do not imply a data migration are applied when data is
+   * available for a certain entity type. If any change fails to comply with
+   * this policy the operation is aborted.
+   *
+   * @param string $entity_type_id
+   *   (optional) The identifier of the entity type whose changes have to be
+   *   applied. Defaults to all the available entity types.
+   *
+   * @throws \Drupal\Core\Entity\EntityStorageException
+   *   This exception is thrown when trying to apply changes that imply a data
+   *   migration, when data is available in the storage.
+   */
+  public function applyChanges($entity_type_id = NULL);
+
+  /**
+   * Returns a human readable summary of the detected changes.
+   *
+   * @param string $entity_type_id
+   *   (optional) The identifier of the entity type to be checked for changes.
+   *   Defaults to all the available entity types.
+   */
+  public function getChangeSummary($entity_type_id = NULL);
+
+  /**
+   * Returns a requirements array describing the current status.
+   *
+   * @param string $phase
+   *   The phase identifier.
+   *
+   * @return array
+   *   A requirements array.
+   *
+   * @see hook_requirements()
+   */
+  public function getSystemRequirements($phase);
+
+}
diff --git a/core/lib/Drupal/Core/Entity/Schema/EntitySchemaProviderInterface.php b/core/lib/Drupal/Core/Entity/Schema/EntitySchemaProviderInterface.php
deleted file mode 100644
index c976782..0000000
--- a/core/lib/Drupal/Core/Entity/Schema/EntitySchemaProviderInterface.php
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\Core\Entity\Schema\EntitySchemaProviderInterface.
- */
-
-namespace Drupal\Core\Entity\Schema;
-
-/**
- * Defines a common interface to return the storage schema for entities.
- */
-interface EntitySchemaProviderInterface {
-
-  /**
-   * Gets the full schema array for a given entity type.
-   *
-   * @return array
-   *   A schema array for the entity type's tables.
-   */
-  public function getSchema();
-
-}
diff --git a/core/lib/Drupal/Core/Entity/Schema/SqlContentEntityStorageSchema.php b/core/lib/Drupal/Core/Entity/Schema/SqlContentEntityStorageSchema.php
index 830d2ab..69baa5d 100644
--- a/core/lib/Drupal/Core/Entity/Schema/SqlContentEntityStorageSchema.php
+++ b/core/lib/Drupal/Core/Entity/Schema/SqlContentEntityStorageSchema.php
@@ -7,14 +7,28 @@
 
 namespace Drupal\Core\Entity\Schema;
 
+use Drupal\Component\Utility\String;
+use Drupal\Core\Database\Connection;
 use Drupal\Core\Entity\ContentEntityDatabaseStorage;
 use Drupal\Core\Entity\ContentEntityTypeInterface;
 use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Entity\EntityStorageException;
+use Drupal\Core\Entity\EntityTypeInterface;
+use Drupal\Core\Entity\Exception\FieldStorageDefinitionUpdateForbiddenException;
+use Drupal\Core\Field\FieldException;
+use Drupal\Core\Field\FieldStorageDefinitionInterface;
 
 /**
  * Defines a schema handler that supports revisionable, translatable entities.
  */
-class SqlContentEntityStorageSchema implements EntitySchemaHandlerInterface {
+class SqlContentEntityStorageSchema implements ContentEntitySchemaHandlerInterface, ContentEntitySchemaProviderInterface {
+
+  /**
+   * The entity manager.
+   *
+   * @var \Drupal\Core\Entity\EntityManagerInterface
+   */
+  protected $entityManager;
 
   /**
    * The entity type this schema builder is responsible for.
@@ -31,6 +45,14 @@ class SqlContentEntityStorageSchema implements EntitySchemaHandlerInterface {
   protected $fieldStorageDefinitions;
 
   /**
+   * The original storage field definitions for this entity type. Used during
+   * field schema updates.
+   *
+   * @var \Drupal\Core\Field\FieldDefinitionInterface[]
+   */
+  protected $originalDefinitions;
+
+  /**
    * The storage object for the given entity type.
    *
    * @var \Drupal\Core\Entity\ContentEntityDatabaseStorage
@@ -45,6 +67,27 @@ class SqlContentEntityStorageSchema implements EntitySchemaHandlerInterface {
   protected $schema;
 
   /**
+   * The database connection to be used.
+   *
+   * @var \Drupal\Core\Database\Connection
+   */
+  protected $database;
+
+  /**
+   * The state service.
+   *
+   * @var \Drupal\Core\State\StateInterface
+   */
+  protected $state;
+
+  /**
+   * The schema manager service.
+   *
+   * @var \Drupal\Core\Entity\Schema\EntitySchemaManagerInterface
+   */
+  protected $schemaManager;
+
+  /**
    * Constructs a SqlContentEntityStorageSchema.
    *
    * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
@@ -53,112 +96,1010 @@ class SqlContentEntityStorageSchema implements EntitySchemaHandlerInterface {
    *   The entity type.
    * @param \Drupal\Core\Entity\ContentEntityDatabaseStorage $storage
    *   The storage of the entity type. This must be an SQL-based storage.
+   * @param \Drupal\Core\Database\Connection $database
+   *   The database connection to be used.
+   */
+  public function __construct(EntityManagerInterface $entity_manager, ContentEntityTypeInterface $entity_type, ContentEntityDatabaseStorage $storage, Connection $database) {
+    $this->entityManager = $entity_manager;
+    $this->entityType = $entity_type;
+    $this->fieldStorageDefinitions = $entity_manager->getFieldStorageDefinitions($entity_type->id());
+    $this->storage = $storage;
+    $this->database = $database;
+  }
+
+  /**
+   * @return \Drupal\Core\State\StateInterface
+   */
+  protected function state() {
+    if (!isset($this->state)) {
+      $this->state = \Drupal::state();
+    }
+    return $this->state;
+  }
+
+  /**
+   * @return \Drupal\Core\Entity\Schema\EntitySchemaManagerInterface
+   */
+  protected function schemaManager() {
+    if (!isset($this->schemaManager)) {
+      $this->schemaManager = \Drupal::service('entity.schema.manager');
+    }
+    return $this->schemaManager;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function requiresEntitySchemaChanges(ContentEntityTypeInterface $definition, ContentEntityTypeInterface $original) {
+    return !$original ||
+      $original->getStorageClass() != $definition->getStorageClass() ||
+      $original->isRevisionable() != $definition->isRevisionable() ||
+      $original->isTranslatable() != $definition->isTranslatable() ||
+      // Detect changes in key or index definitions.
+      $this->loadEntitySchemaData($original) != $this->getEntitySchemaData($definition, $this->getEntitySchema($definition, TRUE));
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function requiresFieldSchemaChanges(FieldStorageDefinitionInterface $definition, FieldStorageDefinitionInterface $original) {
+    return !$original ||
+      $original->getSchema() != $definition->getSchema() ||
+      $original->isRevisionable() != $definition->isRevisionable() ||
+      $original->hasCustomStorage() != $definition->hasCustomStorage() ||
+      $this->requiresFieldDataMigration($definition, $original);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function requiresEntityDataMigration(ContentEntityTypeInterface $definition, ContentEntityTypeInterface $original) {
+    // A change in the storage class may or may not imply a data migration. We
+    // assume it does. This method should be overridden otherwise. Basically the
+    // only schema change that does not imply a data migration is from
+    // revisionable to non revisionable, as in that case we just need to drop
+    // revision tables.
+    return $original->getStorageClass() != $definition->getStorageClass() ||
+      $original->isRevisionable() != $definition->isRevisionable() ||
+      $original->isTranslatable() != $definition->isTranslatable();
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function requiresFieldDataMigration(FieldStorageDefinitionInterface $definition, FieldStorageDefinitionInterface $original) {
+    $table_mapping = $this->storage->getTableMapping();
+
+    // If the field changes its custom storage status, we will need to create or
+    // drop its schema. In any case we cannot migrate its data as custom storage
+    // is involved. Otherwise if a field is moved from a shared table to a
+    // dedicated table or viceversa we need a data migration.
+    $custom_storage = $original->hasCustomStorage() || $definition->hasCustomStorage();
+    $shared_table_changed = $table_mapping->allowsSharedTableStorage($original) != $table_mapping->allowsSharedTableStorage($definition);
+    $dedicated_table_changed = $table_mapping->requiresDedicatedTableStorage($original) != $table_mapping->requiresDedicatedTableStorage($definition);
+    if (!$custom_storage && ($shared_table_changed || $dedicated_table_changed)) {
+      return TRUE;
+    }
+    // If columns change we may need data manipulation, which we cannot handle.
+    if ($original->getColumns() != $definition->getColumns()) {
+      return TRUE;
+    }
+
+    return FALSE;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function onEntityTypeCreate(EntityTypeInterface $entity_type) {
+    $this->checkEntityType($entity_type);
+    $schema_handler = $this->database->schema();
+    $schema = $this->getEntitySchema($entity_type, TRUE);
+    foreach ($schema as $table_name => $table_schema) {
+      if (!$schema_handler->tableExists($table_name)) {
+        $schema_handler->createTable($table_name, $table_schema);
+      }
+    }
+    $this->saveEntitySchemaData($entity_type, $schema);
+    $this->schemaManager()->onEntityTypeCreate($entity_type);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function onEntityTypeUpdate(EntityTypeInterface $entity_type, EntityTypeInterface $original) {
+    $this->checkEntityType($entity_type);
+    $this->checkEntityType($original);
+
+    // If we have no data just recreate the entity schema from scratch.
+    if (!$this->database->schema()->tableExists($this->storage->getBaseTable()) || !$this->storage->hasData()) {
+      if ($this->database->supportsTransactionalDDL()) {
+        // If the database supports transactional DDL, we can go ahead and rely
+        // on it. If not, we will have to rollback manually if something fails.
+        $transaction = $this->database->startTransaction();
+      }
+      try {
+        $this->onEntityTypeDelete($original);
+        $this->onEntityTypeCreate($entity_type);
+
+        // Update dedicated table revision schema.
+        if ($original->isRevisionable() && !$entity_type->isRevisionable()) {
+          $this->dropDedicatedTableRevisionSchema();
+        }
+        elseif (!$original->isRevisionable() && $entity_type->isRevisionable()) {
+          $this->createDedicatedTableRevisionSchema($entity_type);
+        }
+      }
+      catch (\Exception $e) {
+        if ($this->database->supportsTransactionalDDL()) {
+          $transaction->rollback();
+        }
+        else {
+          // Recreate original schema.
+          $this->onEntityTypeCreate($original);
+        }
+        throw $e;
+      }
+    }
+    else {
+      $schema_handler = $this->database->schema();
+
+      // Drop original indexes and unique keys.
+      foreach ($this->loadEntitySchemaData($entity_type) as $table_name => $schema) {
+        if (!empty($schema['indexes'])) {
+          foreach ($schema['indexes'] as $name => $specifier) {
+            $schema_handler->dropIndex($table_name, $name);
+          }
+        }
+        if (!empty($schema['unique keys'])) {
+          foreach ($schema['unique keys'] as $name => $specifier) {
+            $schema_handler->dropUniqueKey($table_name, $name);
+          }
+        }
+      }
+
+      // Create new indexes and unique keys.
+      $entity_schema = $this->getEntitySchema($entity_type, TRUE);
+      foreach ($this->getEntitySchemaData($entity_type, $entity_schema) as $table_name => $schema) {
+        if (!empty($schema['indexes'])) {
+          foreach ($schema['indexes'] as $name => $specifier) {
+            $schema_handler->addIndex($table_name, $name, $specifier);
+          }
+        }
+        if (!empty($schema['unique keys'])) {
+          foreach ($schema['unique keys'] as $name => $specifier) {
+            $schema_handler->addUniqueKey($table_name, $name, $specifier);
+          }
+        }
+      }
+
+      // Store the updated entity schema.
+      $this->saveEntitySchemaData($entity_type, $entity_schema);
+      $this->schemaManager()->onEntityTypeUpdate($entity_type, $original);
+    }
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function onEntityTypeDelete(EntityTypeInterface $entity_type) {
+    $this->checkEntityType($entity_type);
+    $schema_handler = $this->database->schema();
+    $actual_definition = $this->entityManager->getDefinition($entity_type->id());
+    // @todo Instead of switching the wrapped entity type, we should be able to
+    //   instantiate a new table mapping for each entity type definition. See
+    //   https://www.drupal.org/node/2274017.
+    $this->storage->setEntityType($entity_type);
+
+    foreach ($this->getEntitySchemaTables() as $table_name) {
+      if ($schema_handler->tableExists($table_name)) {
+        $schema_handler->dropTable($table_name);
+      }
+    }
+
+    $this->storage->setEntityType($actual_definition);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function onFieldStorageDefinitionCreate(FieldStorageDefinitionInterface $storage_definition) {
+    $this->performFieldSchemaOperation('create', $storage_definition);
+    $this->schemaManager()->onFieldStorageDefinitionCreate($storage_definition);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function onFieldStorageDefinitionUpdate(FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original) {
+    // Store original definitions so that switching between shared and dedicated
+    // field table layout works.
+    $this->originalDefinitions = $this->fieldStorageDefinitions;
+    $this->originalDefinitions[$original->getName()] = $original;
+    $this->performFieldSchemaOperation('update', $storage_definition, $original);
+    $this->originalDefinitions = NULL;
+    $this->schemaManager()->onFieldStorageDefinitionUpdate($storage_definition, $original);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function onFieldStorageDefinitionDelete(FieldStorageDefinitionInterface $storage_definition) {
+    $this->prepareFieldSchemaDeletion($storage_definition);
+    $this->schemaManager()->onFieldStorageDefinitionDelete($storage_definition);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function finalizePurge(FieldStorageDefinitionInterface $storage_definition) {
+    $this->performFieldSchemaOperation('delete', $storage_definition);
+  }
+
+  /**
+   * Creates revision tables for the specified entity type.
+   *
+   * @param \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type
+   *   The entity type definition.
+   */
+  protected function createDedicatedTableRevisionSchema(ContentEntityTypeInterface $entity_type) {
+    $table_mapping = $this->storage->getTableMapping();
+    $schema_manager = $this->database->schema();
+    foreach ($this->fieldStorageDefinitions as $definition) {
+      if ($table_mapping->requiresDedicatedTableStorage($definition)) {
+        $schema = $this->getDedicatedTableSchema($definition, $entity_type);
+        $table_name = $table_mapping->getDedicatedRevisionTableName($definition);
+        $schema_manager->createTable($table_name, $schema[$table_name]);
+      }
+    }
+  }
+
+  /**
+   * Deletes revision tables for the specified entity type.
+   */
+  protected function dropDedicatedTableRevisionSchema() {
+    $table_mapping = $this->storage->getTableMapping();
+    $schema_manager = $this->database->schema();
+    foreach ($this->fieldStorageDefinitions as $definition) {
+      if ($table_mapping->requiresDedicatedTableStorage($definition)) {
+        $schema_manager->dropTable($table_mapping->getDedicatedRevisionTableName($definition));
+      }
+    }
+  }
+
+  /**
+   * Returns the entity schema for the specified entity type.
+   *
+   * @param \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type
+   *   The entity type definition.
+   * @param bool $reset
+   *   (optional) If set to TRUE static cache will be ignored and a new schema
+   *   array generation will be performed. Defaults to FALSE.
+   *
+   * @return array
+   *   A Schema API array describing the entity schema, excluding dedicated
+   *   field tables.
+   *
+   * @throws \Drupal\Core\Field\FieldException
+   */
+  protected function getEntitySchema(ContentEntityTypeInterface $entity_type, $reset = FALSE) {
+    $this->checkEntityType($entity_type);
+    $entity_type_id = $entity_type->id();
+
+    if (!isset($this->schema[$entity_type_id]) || $reset) {
+      // Back up the storage definition and replace it with the passed one.
+      // @todo Instead of switching the wrapped entity type, we should be able
+      //   to instantiate a new table mapping for each entity type definition.
+      //   See https://www.drupal.org/node/2274017.
+      $actual_definition = $this->entityManager->getDefinition($entity_type_id);
+      $this->storage->setEntityType($entity_type);
+
+      // Prepare basic information about the entity type.
+      $tables = $this->getEntitySchemaTables();
+
+      // Initialize the table schema.
+      $schema[$tables['base_table']] = $this->initializeBaseTable($entity_type);
+      if (isset($tables['revision_table'])) {
+        $schema[$tables['revision_table']] = $this->initializeRevisionTable($entity_type);
+      }
+      if (isset($tables['data_table'])) {
+        $schema[$tables['data_table']] = $this->initializeDataTable($entity_type);
+      }
+      if (isset($tables['revision_data_table'])) {
+        $schema[$tables['revision_data_table']] = $this->initializeRevisionDataTable($entity_type);
+      }
+
+      // We need to act only on shared entity schema tables.
+      $table_mapping = $this->storage->getTableMapping();
+      $table_names = array_diff($table_mapping->getTableNames(), $table_mapping->getDedicatedTableNames());
+      $storage_definitions = $this->entityManager->getFieldStorageDefinitions($entity_type_id);
+      foreach ($table_names as $table_name) {
+        if (!isset($schema[$table_name])) {
+          $schema[$table_name] = array();
+        }
+        foreach ($table_mapping->getFieldNames($table_name) as $field_name) {
+          if (!isset($storage_definitions[$field_name])) {
+            throw new FieldException(String::format('Fieled storage definition for "@field_name" could not be found.', array('@field_name' => $field_name)));
+          }
+          // Add the schema for base field definitions.
+          elseif ($table_mapping->allowsSharedTableStorage($storage_definitions[$field_name])) {
+            $column_names = $table_mapping->getColumnNames($field_name);
+            $storage_definition = $storage_definitions[$field_name];
+            $schema[$table_name] = array_merge_recursive($schema[$table_name], $this->getSharedTableFieldSchema($storage_definition, $column_names));
+          }
+        }
+
+        // Add the schema for extra fields.
+        foreach ($table_mapping->getExtraColumns($table_name) as $column_name) {
+          if ($column_name == 'default_langcode') {
+            $this->addDefaultLangcodeSchema($schema[$table_name]);
+          }
+        }
+      }
+
+      // Process tables after having gathered field information.
+      $this->processBaseTable($entity_type, $schema[$tables['base_table']]);
+      if (isset($tables['revision_table'])) {
+        $this->processRevisionTable($entity_type, $schema[$tables['revision_table']]);
+      }
+      if (isset($tables['data_table'])) {
+        $this->processDataTable($entity_type, $schema[$tables['data_table']]);
+      }
+      if (isset($tables['revision_data_table'])) {
+        $this->processRevisionDataTable($entity_type, $schema[$tables['revision_data_table']]);
+      }
+
+      $this->schema[$entity_type_id] = $schema;
+
+      // Restore the actual definition.
+      $this->storage->setEntityType($actual_definition);
+    }
+
+    return $this->schema[$entity_type_id];
+  }
+
+  /**
+   * Checks that we are dealing with the correct entity type.
+   *
+   * @param \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type
+   *   The entity type to be checked.
+   *
+   * @return bool
+   *   TRUE if the entity type matches the current one.
+   *
+   * @throws \Drupal\Core\Entity\EntityStorageException
+   */
+  protected function checkEntityType(ContentEntityTypeInterface $entity_type) {
+    if ($entity_type->id() != $this->entityType->id()) {
+      throw new EntityStorageException(String::format('Unsupported entity type @id', array('@id' => $entity_type->id())));
+    }
+    return TRUE;
+  }
+
+  /**
+   * Gets a list of entity type tables.
+   *
+   * @return array
+   *   A list of entity type tables, keyed by table key.
+   */
+  protected function getEntitySchemaTables() {
+    return array_filter(array(
+      'base_table' => $this->storage->getBaseTable(),
+      'revision_table' => $this->storage->getRevisionTable(),
+      'data_table' => $this->storage->getDataTable(),
+      'revision_data_table' => $this->storage->getRevisionDataTable(),
+    ));
+  }
+
+  /**
+   * Returns entity schema definitions for index and key definitions.
+   *
+   * @param \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type
+   *   The entity type definition.
+   * @param array $schema
+   *   The entity schema array.
+   *
+   * @return array
+   *   A stripped down version of the $schema Schema API array containing, for
+   *   each table, only the key and index definitions not derived from field
+   *   storage definitions.
+   */
+  protected function getEntitySchemaData(ContentEntityTypeInterface $entity_type, array $schema) {
+    $schema_data = array();
+    $entity_type_id = $entity_type->id();
+    $keys = array('indexes', 'unique keys');
+    $unused_keys = array_flip(array('description', 'fields', 'foreign keys'));
+
+    foreach ($schema as $table_name => $table_schema) {
+      $table_schema = array_diff_key($table_schema, $unused_keys);
+      foreach ($keys as $key) {
+        // Exclude data generated from field storage definitions, we will check
+        // that separately.
+        if (!empty($table_schema[$key])) {
+          $data_keys = array_keys($table_schema[$key]);
+          $entity_keys = array_filter($data_keys, function ($key) use ($entity_type_id) {
+            return strpos($key, $entity_type_id . '_field_') !== 0;
+          });
+          $table_schema[$key] = array_intersect_key($table_schema[$key], array_flip($entity_keys));
+        }
+      }
+      $schema_data[$table_name] = array_filter($table_schema);
+    }
+
+    return $schema_data;
+  }
+
+  /**
+   * Loads stored schema data for the given entity type definition.
+   *
+   * @param \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type
+   *   The entity type definition.
+   *
+   * @return array
+   *   The entity schema data array.
+   */
+  protected function loadEntitySchemaData(ContentEntityTypeInterface $entity_type) {
+    return $this->state()->get('entity.schema.handler.' . $entity_type->id() . '.schema_data') ?: array();
+  }
+
+  /**
+   * Stores schema data for the given entity type definition.
+   *
+   * @param \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type
+   *   The entity type definition.
+   * @param array $schema
+   *   The entity schema data array.
+   */
+  protected function saveEntitySchemaData(ContentEntityTypeInterface $entity_type, $schema) {
+    $data = $this->getEntitySchemaData($entity_type, $schema);
+    $this->state()->set('entity.schema.handler.' . $entity_type->id() . '.schema_data', $data);
+  }
+
+  /**
+   * Initializes common information for a base table.
+   *
+   * @param \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type
+   *   The entity type.
+   *
+   * @return array
+   *   A partial schema array for the base table.
+   */
+  protected function initializeBaseTable(ContentEntityTypeInterface $entity_type) {
+    $entity_type_id = $entity_type->id();
+
+    $schema = array(
+      'description' => "The base table for $entity_type_id entities.",
+      'primary key' => array($entity_type->getKey('id')),
+      'indexes' => array(),
+      'foreign keys' => array(),
+    );
+
+    if ($entity_type->hasKey('revision')) {
+      $revision_key = $entity_type->getKey('revision');
+      $key_name = $this->getEntityIndexName($entity_type, $revision_key);
+      $schema['unique keys'][$key_name] = array($revision_key);
+      $schema['foreign keys'][$entity_type_id . '__revision'] = array(
+        'table' => $this->storage->getRevisionTable(),
+        'columns' => array($revision_key => $revision_key),
+      );
+    }
+
+    $this->addTableDefaults($schema);
+
+    return $schema;
+  }
+
+  /**
+   * Initializes common information for a revision table.
+   *
+   * @param \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type
+   *   The entity type.
+   *
+   * @return array
+   *   A partial schema array for the revision table.
+   */
+  protected function initializeRevisionTable(ContentEntityTypeInterface $entity_type) {
+    $entity_type_id = $entity_type->id();
+    $id_key = $entity_type->getKey('id');
+    $revision_key = $entity_type->getKey('revision');
+
+    $schema = array(
+      'description' => "The revision table for $entity_type_id entities.",
+      'primary key' => array($revision_key),
+      'indexes' => array(),
+      'foreign keys' => array(
+        $entity_type_id . '__revisioned' => array(
+          'table' => $this->storage->getBaseTable(),
+          'columns' => array($id_key => $id_key),
+        ),
+      ),
+    );
+
+    $schema['indexes'][$this->getEntityIndexName($entity_type, $id_key)] = array($id_key);
+
+    $this->addTableDefaults($schema);
+
+    return $schema;
+  }
+
+  /**
+   * Initializes common information for a data table.
+   *
+   * @param \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type
+   *   The entity type.
+   *
+   * @return array
+   *   A partial schema array for the data table.
+   */
+  protected function initializeDataTable(ContentEntityTypeInterface $entity_type) {
+    $entity_type_id = $entity_type->id();
+    $id_key = $entity_type->getKey('id');
+
+    $schema = array(
+      'description' => "The data table for $entity_type_id entities.",
+      // @todo Use the language entity key when https://drupal.org/node/2143729
+      //   is in.
+      'primary key' => array($id_key, 'langcode'),
+      'indexes' => array(),
+      'foreign keys' => array(
+        $entity_type_id => array(
+          'table' => $this->storage->getBaseTable(),
+          'columns' => array($id_key => $id_key),
+        ),
+      ),
+    );
+
+    if ($entity_type->hasKey('revision')) {
+      $key = $entity_type->getKey('revision');
+      $schema['indexes'][$this->getEntityIndexName($entity_type, $key)] = array($key);
+    }
+
+    $this->addTableDefaults($schema);
+
+    return $schema;
+  }
+
+  /**
+   * Initializes common information for a revision data table.
+   *
+   * @param \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type
+   *   The entity type.
+   *
+   * @return array
+   *   A partial schema array for the revision data table.
+   */
+  protected function initializeRevisionDataTable(ContentEntityTypeInterface $entity_type) {
+    $entity_type_id = $entity_type->id();
+    $id_key = $entity_type->getKey('id');
+    $revision_key = $entity_type->getKey('revision');
+
+    $schema = array(
+      'description' => "The revision data table for $entity_type_id entities.",
+      // @todo Use the language entity key when https://drupal.org/node/2143729
+      //   is in.
+      'primary key' => array($revision_key, 'langcode'),
+      'indexes' => array(),
+      'foreign keys' => array(
+        $entity_type_id => array(
+          'table' => $this->storage->getBaseTable(),
+          'columns' => array($id_key => $id_key),
+        ),
+        $entity_type_id . '__revision' => array(
+          'table' => $this->storage->getRevisionTable(),
+          'columns' => array($revision_key => $revision_key),
+        )
+      ),
+    );
+
+    $this->addTableDefaults($schema);
+
+    return $schema;
+  }
+
+  /**
+   * Processes the gathered schema for a base table.
+   *
+   * @param \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type
+   *   The entity type.
+   * @param array $schema
+   *   The table schema, passed by reference.
+   *
+   * @return array
+   *   A partial schema array for the base table.
+   */
+  protected function processBaseTable(ContentEntityTypeInterface $entity_type, array &$schema) {
+    $this->processIdentifierSchema($schema, $entity_type->getKey('id'));
+  }
+
+  /**
+   * Processes the gathered schema for a base table.
+   *
+   * @param \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type
+   *   The entity type.
+   * @param array $schema
+   *   The table schema, passed by reference.
+   *
+   * @return array
+   *   A partial schema array for the base table.
+   */
+  protected function processRevisionTable(ContentEntityTypeInterface $entity_type, array &$schema) {
+    $this->processIdentifierSchema($schema, $entity_type->getKey('revision'));
+  }
+
+  /**
+   * Processes the gathered schema for a base table.
+   *
+   * @param \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type
+   *   The entity type.
+   * @param array $schema
+   *   The table schema, passed by reference.
+   *
+   * @return array
+   *   A partial schema array for the base table.
+   */
+  protected function processDataTable(ContentEntityTypeInterface $entity_type, array &$schema) {
+  }
+
+  /**
+   * Processes the gathered schema for a base table.
+   *
+   * @param \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type
+   *   The entity type.
+   * @param array $schema
+   *   The table schema, passed by reference.
+   *
+   * @return array
+   *   A partial schema array for the base table.
+   */
+  protected function processRevisionDataTable(ContentEntityTypeInterface $entity_type, array &$schema) {
+  }
+
+  /**
+   * Performs the specified operation on a field.
+   *
+   * This figures out whether the field is stored in a dedicated or shared table
+   * and forwards the call to the proper handler.
+   *
+   * @param string $operation
+   *   The name of the operation to be performed.
+   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition
+   *   The field storage definition.
+   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $original
+   *   (optional) The original field storage definition. This is relevant (and
+   *   required) only for updates. Defaults to NULL.
+   */
+  protected function performFieldSchemaOperation($operation, FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original = NULL) {
+    $table_mapping = $this->storage->getTableMapping();
+    if ($table_mapping->requiresDedicatedTableStorage($storage_definition)) {
+      $this->{$operation . 'DedicatedTableSchema'}($storage_definition, $original);
+    }
+    elseif ($table_mapping->allowsSharedTableStorage($storage_definition)) {
+      $this->{$operation . 'SharedTableSchema'}($storage_definition, $original);
+    }
+  }
+
+  /**
+   * Creates the schema for a field stored in a dedicated table.
+   *
+   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition
+   *   The storage definition of the field being created.
+   */
+  protected function createDedicatedTableSchema(FieldStorageDefinitionInterface $storage_definition) {
+    $schema = $this->getDedicatedTableSchema($storage_definition);
+    foreach ($schema as $name => $table) {
+      $this->database->schema()->createTable($name, $table);
+    }
+  }
+
+  /**
+   * Creates the schema for a field stored in a shared table.
+   *
+   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition
+   *   The storage definition of the field being created.
+   */
+  protected function createSharedTableSchema(FieldStorageDefinitionInterface $storage_definition) {
+    $created_field_name = $storage_definition->getName();
+    $table_mapping = $this->storage->getTableMapping();
+    $column_names = $table_mapping->getColumnNames($created_field_name);
+    $schema = $this->getSharedTableFieldSchema($storage_definition, $column_names);
+    $keys = array_diff_key($schema, array('fields' => FALSE));
+    $shared_table_names = array_diff($table_mapping->getTableNames(), $table_mapping->getDedicatedTableNames());
+
+    // Iterate over the mapped table to find the ones that will host the created
+    // field schema.
+    foreach ($shared_table_names as $table_name) {
+      foreach ($table_mapping->getFieldNames($table_name) as $field_name) {
+        if ($field_name == $created_field_name) {
+          foreach ($schema['fields'] as $column_name => $specifier) {
+            $this->database->schema()->addField($table_name, $column_name, $specifier, $keys);
+          }
+          // After creating the field schema skip to the next table.
+          break;
+        }
+      }
+    }
+  }
+
+  /**
+   * @todo Document.
+   */
+  protected function prepareFieldSchemaDeletion(FieldStorageDefinitionInterface $storage_definition) {
+    $table_mapping = $this->storage->getTableMapping();
+    // @todo Implement this also for shared table storage. See
+    //   https://www.drupal.org/node/2282119.
+    if ($table_mapping->requiresDedicatedTableStorage($storage_definition)) {
+      // Move the table to a unique name while the table contents are being
+      // deleted.
+      $table = $table_mapping->getDedicatedDataTableName($storage_definition);
+      $new_table = $table_mapping->getDedicatedDataTableName($storage_definition, TRUE);
+      $this->database->schema()->renameTable($table, $new_table);
+      if ($this->entityType->isRevisionable()) {
+        $revision_table = $table_mapping->getDedicatedRevisionTableName($storage_definition);
+        $revision_new_table = $table_mapping->getDedicatedRevisionTableName($storage_definition, TRUE);
+        $this->database->schema()->renameTable($revision_table, $revision_new_table);
+      }
+    }
+  }
+
+  /**
+   * Deletes the schema for a field stored in a dedicated table.
+   *
+   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition
+   *   The storage definition of the field being deleted.
    */
-  public function __construct(EntityManagerInterface $entity_manager, ContentEntityTypeInterface $entity_type, ContentEntityDatabaseStorage $storage) {
-    $this->entityType = $entity_type;
-    $this->fieldStorageDefinitions = $entity_manager->getFieldStorageDefinitions($entity_type->id());
-    $this->storage = $storage;
+  protected function deleteDedicatedTableSchema(FieldStorageDefinitionInterface $storage_definition) {
+    // When switching from dedicated to shared field table layout we need need
+    // to delete the field tables with their regular names. When this happens
+    // original definitions will be defined.
+    $deleted = !$this->originalDefinitions;
+    $table_mapping = $this->storage->getTableMapping();
+    $table_name = $table_mapping->getDedicatedDataTableName($storage_definition, $deleted);
+    $this->database->schema()->dropTable($table_name);
+    if ($this->entityType->isRevisionable()) {
+      $revision_name = $table_mapping->getDedicatedRevisionTableName($storage_definition, $deleted);
+      $this->database->schema()->dropTable($revision_name);
+    }
   }
 
   /**
-   * {@inheritdoc}
+   * Deletes the schema for a field stored in a shared table.
+   *
+   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition
+   *   The storage definition of the field being deleted.
    */
-  public function getSchema() {
-    return $this->getEntitySchema($this->entityType);
+  protected function deleteSharedTableSchema(FieldStorageDefinitionInterface $storage_definition) {
+    $deleted_field_name = $storage_definition->getName();
+    $table_mapping = $this->storage->getTableMapping($this->originalDefinitions);
+    $column_names = $table_mapping->getColumnNames($deleted_field_name);
+    $schema = $this->getSharedTableFieldSchema($storage_definition, $column_names);
+    $schema_handler = $this->database->schema();
+    $shared_table_names = array_diff($table_mapping->getTableNames(), $table_mapping->getDedicatedTableNames());
+
+    // Iterate over the mapped table to find the ones that host the deleted
+    // field schema.
+    foreach ($shared_table_names as $table_name) {
+      foreach ($table_mapping->getFieldNames($table_name) as $field_name) {
+        if ($field_name == $deleted_field_name) {
+          // Drop indexes and unique keys first.
+          if (!empty($schema['indexes'])) {
+            foreach ($schema['indexes'] as $name => $specifier) {
+              $schema_handler->dropIndex($table_name, $name);
+            }
+          }
+          if (!empty($schema['unique keys'])) {
+            foreach ($schema['unique keys'] as $name => $specifier) {
+              $schema_handler->dropUniqueKey($table_name, $name);
+            }
+          }
+          // Drop columns.
+          foreach ($column_names as $column_name) {
+            $schema_handler->dropField($table_name, $column_name);
+          }
+          // After deleting the field schema skip to the next table.
+          break;
+        }
+      }
+    }
   }
 
   /**
-   * Returns the entity schema for the specified entity type.
+   * Updates the schema for a field stored in a shared table.
    *
-   * @param \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type
-   *   The entity type definition.
-   * @param bool $reset
-   *   (optional) If set to TRUE static cache will be ignored and a new schema
-   *   array generation will be performed. Defaults to FALSE.
+   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition
+   *   The storage definition of the field being updated.
+   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $original
+   *   The original storage definition; i.e., the definition before the update.
    *
-   * @return array
-   *   A Schema API array describing the entity schema, excluding dedicated
-   *   field tables.
+   * @throws \Drupal\Core\Entity\Exception\FieldStorageDefinitionUpdateForbiddenException
+   *   Thrown when the update to the field is forbidden.
+   * @throws \Exception
+   *   Rethrown exception if the table recreation fails.
    */
-  protected function getEntitySchema(ContentEntityTypeInterface $entity_type, $reset = FALSE) {
-    $entity_type_id = $entity_type->id();
-
-    if (!isset($this->schema[$entity_type_id]) || $reset) {
-      // Initialize the table schema.
-      $tables = $this->getTables();
-      $schema[$tables['base_table']] = $this->initializeBaseTable();
-      if (isset($tables['revision_table'])) {
-        $schema[$tables['revision_table']] = $this->initializeRevisionTable();
+  protected function updateDedicatedTableSchema(FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original) {
+    if (!$this->storage->countFieldData($original, TRUE)) {
+      // There is no data. Re-create the tables completely.
+      if ($this->database->supportsTransactionalDDL()) {
+        // If the database supports transactional DDL, we can go ahead and rely
+        // on it. If not, we will have to rollback manually if something fails.
+        $transaction = $this->database->startTransaction();
       }
-      if (isset($tables['data_table'])) {
-        $schema[$tables['data_table']] = $this->initializeDataTable();
+      try {
+        // Since there is no data we may be switching from a shared table schema
+        // to a dedicated table schema, hence we should use the proper API.
+        $this->performFieldSchemaOperation('delete', $original);
+        $this->performFieldSchemaOperation('create', $storage_definition);
       }
-      if (isset($tables['revision_data_table'])) {
-        $schema[$tables['revision_data_table']] = $this->initializeRevisionDataTable();
+      catch (\Exception $e) {
+        if ($this->database->supportsTransactionalDDL()) {
+          $transaction->rollback();
+        }
+        else {
+          // Recreate tables.
+          $this->performFieldSchemaOperation('create', $original);
+        }
+        throw $e;
       }
-
+    }
+    else {
+      if ($storage_definition->getColumns() != $original->getColumns()) {
+        throw new FieldStorageDefinitionUpdateForbiddenException("The SQL storage cannot change the schema for an existing field with data.");
+      }
+      // There is data, so there are no column changes. Drop all the prior
+      // indexes and create all the new ones, except for all the priors that
+      // exist unchanged.
       $table_mapping = $this->storage->getTableMapping();
-      foreach ($table_mapping->getTableNames() as $table_name) {
-        // Add the schema from field definitions.
-        foreach ($table_mapping->getFieldNames($table_name) as $field_name) {
-          $column_names = $table_mapping->getColumnNames($field_name);
-          $this->addFieldSchema($schema[$table_name], $field_name, $column_names);
-        }
+      $table = $table_mapping->getDedicatedDataTableName($original);
+      $revision_table = $table_mapping->getDedicatedRevisionTableName($original);
 
-        // Add the schema for extra fields.
-        foreach ($table_mapping->getExtraColumns($table_name) as $column_name) {
-          if ($column_name == 'default_langcode') {
-            $this->addDefaultLangcodeSchema($schema[$table_name]);
+      $schema = $storage_definition->getSchema();
+      $original_schema = $original->getSchema();
+
+      foreach ($original_schema['indexes'] as $name => $columns) {
+        if (!isset($schema['indexes'][$name]) || $columns != $schema['indexes'][$name]) {
+          $real_name = $this->getFieldIndexName($storage_definition, $name);
+          $this->database->schema()->dropIndex($table, $real_name);
+          $this->database->schema()->dropIndex($revision_table, $real_name);
+        }
+      }
+      $table = $table_mapping->getDedicatedDataTableName($storage_definition);
+      $revision_table = $table_mapping->getDedicatedRevisionTableName($storage_definition);
+      foreach ($schema['indexes'] as $name => $columns) {
+        if (!isset($original_schema['indexes'][$name]) || $columns != $original_schema['indexes'][$name]) {
+          $real_name = $this->getFieldIndexName($storage_definition, $name);
+          $real_columns = array();
+          foreach ($columns as $column_name) {
+            // Indexes can be specified as either a column name or an array with
+            // column name and length. Allow for either case.
+            if (is_array($column_name)) {
+              $real_columns[] = array(
+                $table_mapping->getFieldColumnName($storage_definition, $column_name[0]),
+                $column_name[1],
+              );
+            }
+            else {
+              $real_columns[] = $table_mapping->getFieldColumnName($storage_definition, $column_name);
+            }
           }
+          $this->database->schema()->addIndex($table, $real_name, $real_columns);
+          $this->database->schema()->addIndex($revision_table, $real_name, $real_columns);
         }
       }
+    }
+  }
 
-      // Process tables after having gathered field information.
-      $this->processBaseTable($schema[$tables['base_table']]);
-      if (isset($tables['revision_table'])) {
-        $this->processRevisionTable($schema[$tables['revision_table']]);
+  /**
+   * Updates the schema for a field stored in a shared table.
+   *
+   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition
+   *   The storage definition of the field being updated.
+   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $original
+   *   The original storage definition; i.e., the definition before the update.
+   *
+   * @throws \Drupal\Core\Entity\Exception\FieldStorageDefinitionUpdateForbiddenException
+   *   Thrown when the update to the field is forbidden.
+   * @throws \Exception
+   *   Rethrown exception if the table recreation fails.
+   */
+  protected function updateSharedTableSchema(FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original) {
+    if (!$this->storage->countFieldData($original, TRUE)) {
+      if ($this->database->supportsTransactionalDDL()) {
+        // If the database supports transactional DDL, we can go ahead and rely
+        // on it. If not, we will have to rollback manually if something fails.
+        $transaction = $this->database->startTransaction();
       }
-      if (isset($tables['data_table'])) {
-        $this->processDataTable($schema[$tables['data_table']]);
+      try {
+        // Since there is no data we may be switching from a dedicated table
+        // to a schema table schema, hence we should use the proper API.
+        $this->performFieldSchemaOperation('delete', $original);
+        $this->performFieldSchemaOperation('create', $storage_definition);
       }
-      if (isset($tables['revision_data_table'])) {
-        $this->processRevisionDataTable($schema[$tables['revision_data_table']]);
+      catch (\Exception $e) {
+        if ($this->database->supportsTransactionalDDL()) {
+          $transaction->rollback();
+        }
+        else {
+          // Recreate original schema.
+          $this->createSharedTableSchema($original);
+        }
+        throw $e;
       }
-
-      $this->schema[$entity_type_id] = $schema;
     }
+    else {
+      if ($storage_definition->getColumns() != $original->getColumns()) {
+        throw new FieldStorageDefinitionUpdateForbiddenException("The SQL storage cannot change the schema for an existing field with data.");
+      }
 
-    return $this->schema[$entity_type_id];
-  }
+      $updated_field_name = $storage_definition->getName();
+      $table_mapping = $this->storage->getTableMapping();
+      $column_names = $table_mapping->getColumnNames($updated_field_name);
+      $original_schema = $this->getSharedTableFieldSchema($original, $column_names);
+      $schema = $this->getSharedTableFieldSchema($storage_definition, $column_names);
+      $schema_handler = $this->database->schema();
 
-  /**
-   * Gets a list of entity type tables.
-   *
-   * @return array
-   *   A list of entity type tables, keyed by table key.
-   */
-  protected function getTables() {
-    return array_filter(array(
-      'base_table' => $this->storage->getBaseTable(),
-      'revision_table' => $this->storage->getRevisionTable(),
-      'data_table' => $this->storage->getDataTable(),
-      'revision_data_table' => $this->storage->getRevisionDataTable(),
-    ));
+      // Iterate over the mapped table to find the ones that host the deleted
+      // field schema.
+      foreach ($table_mapping->getTableNames() as $table_name) {
+        foreach ($table_mapping->getFieldNames($table_name) as $field_name) {
+          if ($field_name == $updated_field_name) {
+            // Drop original indexes and unique keys.
+            if (!empty($original_schema['indexes'])) {
+              foreach ($original_schema['indexes'] as $name => $specifier) {
+                $schema_handler->dropIndex($table_name, $name);
+              }
+            }
+            if (!empty($original_schema['unique keys'])) {
+              foreach ($original_schema['unique keys'] as $name => $specifier) {
+                $schema_handler->dropUniqueKey($table_name, $name);
+              }
+            }
+            // Create new indexes and unique keys.
+            if (!empty($schema['indexes'])) {
+              foreach ($schema['indexes'] as $name => $specifier) {
+                $schema_handler->addIndex($table_name, $name, $specifier);
+              }
+            }
+            if (!empty($schema['unique keys'])) {
+              foreach ($schema['unique keys'] as $name => $specifier) {
+                $schema_handler->addUniqueKey($table_name, $name, $specifier);
+              }
+            }
+            // After deleting the field schema skip to the next table.
+            break;
+          }
+        }
+      }
+    }
   }
 
   /**
    * Returns the schema for a single field definition.
    *
-   * @param array $schema
-   *   The table schema to add the field schema to, passed by reference.
-   * @param string $field_name
-   *   The name of the field.
+   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition
+   *   The storage definition of the field whose schema has to be returned.
    * @param string[] $column_mapping
    *   A mapping of field column names to database column names.
+   *
+   * @return array
+   *   The schema definition for the table with the following keys:
+   *   - fields: The schema definition for the each field columns.
+   *   - indexes: The schema definition for the indexes.
+   *   - unique keys: The schema definition for the unique keys.
+   *   - foreign keys: The schema definition for the foreign keys.
+   *
+   * @throws \Drupal\Core\Field\FieldException
+   *   Exception thrown if the schema contains reserved column names.
    */
-  protected function addFieldSchema(array &$schema, $field_name, array $column_mapping) {
-    $field_schema = $this->fieldStorageDefinitions[$field_name]->getSchema();
-    $field_description = $this->fieldStorageDefinitions[$field_name]->getDescription();
+  protected function getSharedTableFieldSchema(FieldStorageDefinitionInterface $storage_definition, array $column_mapping) {
+    $schema = array();
+    $field_schema = $storage_definition->getSchema();
+
+    // Check that the schema does not include forbidden column names.
+    if (array_intersect(array_keys($field_schema['columns']), $this->storage->getTableMapping()->getReservedColumns())) {
+      throw new FieldException(format_string('Illegal field column names on @field_name', array('@field_name' => $storage_definition->getName())));
+    }
+
+    $field_name = $storage_definition->getName();
+    $field_description = $storage_definition->getDescription();
 
     foreach ($column_mapping as $field_column_name => $schema_field_name) {
       $column_schema = $field_schema['columns'][$field_column_name];
@@ -183,19 +1124,18 @@ protected function addFieldSchema(array &$schema, $field_name, array $column_map
     }
 
     if (!empty($field_schema['indexes'])) {
-      $indexes = $this->getFieldIndexes($field_name, $field_schema, $column_mapping);
-      $schema['indexes'] = array_merge($schema['indexes'], $indexes);
+      $schema['indexes'] = $this->getFieldIndexes($field_name, $field_schema, $column_mapping);
     }
 
     if (!empty($field_schema['unique keys'])) {
-      $unique_keys = $this->getFieldUniqueKeys($field_name, $field_schema, $column_mapping);
-      $schema['unique keys'] = array_merge($schema['unique keys'], $unique_keys);
+      $schema['unique keys'] = $this->getFieldUniqueKeys($field_name, $field_schema, $column_mapping);
     }
 
     if (!empty($field_schema['foreign keys'])) {
-      $foreign_keys = $this->getFieldForeignKeys($field_name, $field_schema, $column_mapping);
-      $schema['foreign keys'] = array_merge($schema['foreign keys'], $foreign_keys);
+      $schema['foreign keys'] = $this->getFieldForeignKeys($field_name, $field_schema, $column_mapping);
     }
+
+    return $schema;
   }
 
   /**
@@ -354,133 +1294,170 @@ protected function addDefaultLangcodeSchema(&$schema) {
     );
   }
 
+
   /**
-   * Initializes common information for a base table.
+   * Returns the SQL schema for a dedicated table.
+   *
+   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition
+   *   The field storage definition.
+   * @param \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type
+   *   (optional) The entity type definition. Defaults to the one returned by
+   *   the entity manager.
    *
    * @return array
-   *   A partial schema array for the base table.
+   *   The schema definition for the table with the following keys:
+   *   - fields: The schema definition for the each field columns.
+   *   - indexes: The schema definition for the indexes.
+   *   - unique keys: The schema definition for the unique keys.
+   *   - foreign keys: The schema definition for the foreign keys.
+   *
+   * @throws \Drupal\Core\Field\FieldException
+   *   Exception thrown if the schema contains reserved column names.
+   *
+   * @see hook_schema()
    */
-  protected function initializeBaseTable() {
-    $entity_type_id = $this->entityType->id();
+  protected function getDedicatedTableSchema(FieldStorageDefinitionInterface $storage_definition, ContentEntityTypeInterface $entity_type = NULL) {
+    $description_current = "Data storage for {$storage_definition->getTargetEntityTypeId()} field {$storage_definition->getName()}.";
+    $description_revision = "Revision archive storage for {$storage_definition->getTargetEntityTypeId()} field {$storage_definition->getName()}.";
 
-    $schema = array(
-      'description' => "The base table for $entity_type_id entities.",
-      'primary key' => array($this->entityType->getKey('id')),
-      'indexes' => array(),
-      'foreign keys' => array(),
-    );
-
-    if ($this->entityType->hasKey('revision')) {
-      $revision_key = $this->entityType->getKey('revision');
-      $key_name = $this->getEntityIndexName($revision_key);
-      $schema['unique keys'][$key_name] = array($revision_key);
-      $schema['foreign keys'][$entity_type_id . '__revision'] = array(
-        'table' => $this->storage->getRevisionTable(),
-        'columns' => array($revision_key => $revision_key),
+    $id_definition = $this->fieldStorageDefinitions[$this->entityType->getKey('id')];
+    if ($id_definition->getType() == 'integer') {
+      $id_schema = array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'description' => 'The entity id this data is attached to',
+      );
+    }
+    else {
+      $id_schema = array(
+        'type' => 'varchar',
+        'length' => 128,
+        'not null' => TRUE,
+        'description' => 'The entity id this data is attached to',
       );
     }
 
-    $this->addTableDefaults($schema);
-
-    return $schema;
-  }
-
-  /**
-   * Initializes common information for a revision table.
-   *
-   * @return array
-   *   A partial schema array for the revision table.
-   */
-  protected function initializeRevisionTable() {
-    $entity_type_id = $this->entityType->id();
-    $id_key = $this->entityType->getKey('id');
-    $revision_key = $this->entityType->getKey('revision');
+    // Define the revision ID schema, default to integer if there is no revision
+    // ID.
+    // @todo Revisit this code: the revision id should match the entity id type
+    //   if revisions are not supported.
+    $revision_id_definition = $this->entityType->isRevisionable() ? $this->fieldStorageDefinitions[$this->entityType->getKey('revision')] : NULL;
+    if (!$revision_id_definition || $revision_id_definition->getType() == 'integer') {
+      $revision_id_schema = array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => FALSE,
+        'description' => 'The entity revision id this data is attached to, or NULL if the entity type is not versioned',
+      );
+    }
+    else {
+      $revision_id_schema = array(
+        'type' => 'varchar',
+        'length' => 128,
+        'not null' => FALSE,
+        'description' => 'The entity revision id this data is attached to, or NULL if the entity type is not versioned',
+      );
+    }
 
-    $schema = array(
-      'description' => "The revision table for $entity_type_id entities.",
-      'primary key' => array($revision_key),
-      'indexes' => array(),
-      'foreign keys' => array(
-         $entity_type_id . '__revisioned' => array(
-          'table' => $this->storage->getBaseTable(),
-          'columns' => array($id_key => $id_key),
+    $data_schema = array(
+      'description' => $description_current,
+      'fields' => array(
+        'bundle' => array(
+          'type' => 'varchar',
+          'length' => 128,
+          'not null' => TRUE,
+          'default' => '',
+          'description' => 'The field instance bundle to which this row belongs, used when deleting a field instance',
         ),
-      ),
-    );
-
-    $schema['indexes'][$this->getEntityIndexName($id_key)] = array($id_key);
-
-    $this->addTableDefaults($schema);
-
-    return $schema;
-  }
-
-  /**
-   * Initializes common information for a data table.
-   *
-   * @return array
-   *   A partial schema array for the data table.
-   */
-  protected function initializeDataTable() {
-    $entity_type_id = $this->entityType->id();
-    $id_key = $this->entityType->getKey('id');
-
-    $schema = array(
-      'description' => "The data table for $entity_type_id entities.",
-      // @todo Use the language entity key when https://drupal.org/node/2143729
-      //   is in.
-      'primary key' => array($id_key, 'langcode'),
-      'indexes' => array(),
-      'foreign keys' => array(
-        $entity_type_id => array(
-          'table' => $this->storage->getBaseTable(),
-          'columns' => array($id_key => $id_key),
+        'deleted' => array(
+          'type' => 'int',
+          'size' => 'tiny',
+          'not null' => TRUE,
+          'default' => 0,
+          'description' => 'A boolean indicating whether this data item has been deleted'
+        ),
+        'entity_id' => $id_schema,
+        'revision_id' => $revision_id_schema,
+        'langcode' => array(
+          'type' => 'varchar',
+          'length' => 32,
+          'not null' => TRUE,
+          'default' => '',
+          'description' => 'The language code for this data item.',
+        ),
+        'delta' => array(
+          'type' => 'int',
+          'unsigned' => TRUE,
+          'not null' => TRUE,
+          'description' => 'The sequence number for this data item, used for multi-value fields',
         ),
       ),
+      'primary key' => array('entity_id', 'deleted', 'delta', 'langcode'),
+      'indexes' => array(
+        'bundle' => array('bundle'),
+        'deleted' => array('deleted'),
+        'entity_id' => array('entity_id'),
+        'revision_id' => array('revision_id'),
+        'langcode' => array('langcode'),
+      ),
     );
 
-    if ($this->entityType->hasKey('revision')) {
-      $key = $this->entityType->getKey('revision');
-      $schema['indexes'][$this->getEntityIndexName($key)] = array($key);
+    // Check that the schema does not include forbidden column names.
+    $schema = $storage_definition->getSchema();
+    $table_mapping = $this->storage->getTableMapping();
+    if (array_intersect(array_keys($schema['columns']), $table_mapping->getReservedColumns())) {
+      throw new FieldException(format_string('Illegal field column names on @field_name', array('@field_name' => $storage_definition->getName())));
     }
 
-    $this->addTableDefaults($schema);
+    // Add field columns.
+    foreach ($schema['columns'] as $column_name => $attributes) {
+      $real_name = $table_mapping->getFieldColumnName($storage_definition, $column_name);
+      $data_schema['fields'][$real_name] = $attributes;
+    }
 
-    return $schema;
-  }
+    // Add indexes.
+    foreach ($schema['indexes'] as $index_name => $columns) {
+      $real_name = $this->getFieldIndexName($storage_definition, $index_name);
+      foreach ($columns as $column_name) {
+        // Indexes can be specified as either a column name or an array with
+        // column name and length. Allow for either case.
+        if (is_array($column_name)) {
+          $data_schema['indexes'][$real_name][] = array(
+            $table_mapping->getFieldColumnName($storage_definition, $column_name[0]),
+            $column_name[1],
+          );
+        }
+        else {
+          $data_schema['indexes'][$real_name][] = $table_mapping->getFieldColumnName($storage_definition, $column_name);
+        }
+      }
+    }
 
-  /**
-   * Initializes common information for a revision data table.
-   *
-   * @return array
-   *   A partial schema array for the revision data table.
-   */
-  protected function initializeRevisionDataTable() {
-    $entity_type_id = $this->entityType->id();
-    $id_key = $this->entityType->getKey('id');
-    $revision_key = $this->entityType->getKey('revision');
+    // Add foreign keys.
+    foreach ($schema['foreign keys'] as $specifier => $specification) {
+      $real_name = $this->getFieldIndexName($storage_definition, $specifier);
+      $data_schema['foreign keys'][$real_name]['table'] = $specification['table'];
+      foreach ($specification['columns'] as $column_name => $referenced) {
+        $sql_storage_column = $table_mapping->getFieldColumnName($storage_definition, $column_name);
+        $data_schema['foreign keys'][$real_name]['columns'][$sql_storage_column] = $referenced;
+      }
+    }
 
-    $schema = array(
-      'description' => "The revision data table for $entity_type_id entities.",
-      // @todo Use the language entity key when https://drupal.org/node/2143729
-      //   is in.
-      'primary key' => array($revision_key, 'langcode'),
-      'indexes' => array(),
-      'foreign keys' => array(
-        $entity_type_id => array(
-          'table' => $this->storage->getBaseTable(),
-          'columns' => array($id_key => $id_key),
-        ),
-        $entity_type_id . '__revision' => array(
-          'table' => $this->storage->getRevisionTable(),
-          'columns' => array($revision_key => $revision_key),
-        )
-      ),
-    );
+    $dedicated_table_schema = array($table_mapping->getDedicatedDataTableName($storage_definition) => $data_schema);
 
-    $this->addTableDefaults($schema);
+    // If the entity type is revisionable, construct the revision table.
+    $entity_type = $entity_type ?: $this->entityType;
+    if ($entity_type->isRevisionable()) {
+      $revision_schema = $data_schema;
+      $revision_schema['description'] = $description_revision;
+      $revision_schema['primary key'] = array('entity_id', 'revision_id', 'deleted', 'delta', 'langcode');
+      $revision_schema['fields']['revision_id']['not null'] = TRUE;
+      $revision_schema['fields']['revision_id']['description'] = 'The entity revision id this data is attached to';
+      $dedicated_table_schema += array($table_mapping->getDedicatedRevisionTableName($storage_definition) => $revision_schema);
+    }
 
-    return $schema;
+    return $dedicated_table_schema;
   }
 
   /**
@@ -499,53 +1476,34 @@ protected function addTableDefaults(&$schema) {
   }
 
   /**
-   * Processes the gathered schema for a base table.
-   *
-   * @param array $schema
-   *   The table schema, passed by reference.
-   *
-   * @return array
-   *   A partial schema array for the base table.
-   */
-  protected function processBaseTable(array &$schema) {
-    $this->processIdentifierSchema($schema, $this->entityType->getKey('id'));
-  }
-
-  /**
-   * Processes the gathered schema for a base table.
-   *
-   * @param array $schema
-   *   The table schema, passed by reference.
-   *
-   * @return array
-   *   A partial schema array for the base table.
-   */
-  protected function processRevisionTable(array &$schema) {
-    $this->processIdentifierSchema($schema, $this->entityType->getKey('revision'));
-  }
-
-  /**
-   * Processes the gathered schema for a base table.
+   * Returns the name to be used for the given entity index.
    *
-   * @param array $schema
-   *   The table schema, passed by reference.
+   * @param \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type
+   *   The entity type.
+   * @param string $index
+   *   The index column name.
    *
-   * @return array
-   *   A partial schema array for the base table.
+   * @return string
+   *   The index name.
    */
-  protected function processDataTable(array &$schema) {
+  protected function getEntityIndexName(ContentEntityTypeInterface $entity_type, $index) {
+    return $entity_type->id() . '__' . $index;
   }
 
   /**
-   * Processes the gathered schema for a base table.
+   * Generates an index name for a field data table.
    *
-   * @param array $schema
-   *   The table schema, passed by reference.
+   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition
+   *   The field storage definition.
+   * @param string $index
+   *   The name of the index.
    *
-   * @return array
-   *   A partial schema array for the base table.
+   * @return string
+   *   A string containing a generated index name for a field data table that is
+   *   unique among all other fields.
    */
-  protected function processRevisionDataTable(array &$schema) {
+  protected function getFieldIndexName(FieldStorageDefinitionInterface $storage_definition, $index) {
+    return $storage_definition->getName() . '_' . $index;
   }
 
   /**
@@ -563,17 +1521,4 @@ protected function processIdentifierSchema(&$schema, $key) {
     unset($schema['fields'][$key]['default']);
   }
 
-  /**
-   * Returns the name to be used for the given entity index.
-   *
-   * @param string $index
-   *   The index column name.
-   *
-   * @return string
-   *   The index name.
-   */
-  protected function getEntityIndexName($index) {
-    return $this->entityType->id() . '__' . $index;
-  }
-
 }
diff --git a/core/lib/Drupal/Core/Entity/Sql/DefaultTableMapping.php b/core/lib/Drupal/Core/Entity/Sql/DefaultTableMapping.php
index 4e1546b..ee92918 100644
--- a/core/lib/Drupal/Core/Entity/Sql/DefaultTableMapping.php
+++ b/core/lib/Drupal/Core/Entity/Sql/DefaultTableMapping.php
@@ -15,13 +15,20 @@
 class DefaultTableMapping implements TableMappingInterface {
 
   /**
-   * A list of field storage definitions that are available for this mapping.
+   * The field storage definitions of this mapping.
    *
    * @var \Drupal\Core\Field\FieldStorageDefinitionInterface[]
    */
   protected $fieldStorageDefinitions = array();
 
   /**
+   * The base field definitions of this mapping.
+   *
+   * @var \Drupal\Core\Field\FieldDefinitionInterface[]
+   */
+  protected $baseFieldDefinitions = array();
+
+  /**
    * A list of field names per table.
    *
    * This corresponds to the return value of
@@ -76,11 +83,13 @@ class DefaultTableMapping implements TableMappingInterface {
    * Constructs a DefaultTableMapping.
    *
    * @param \Drupal\Core\Field\FieldStorageDefinitionInterface[] $storage_definitions
-   *   A list of field storage definitions that should be available for the
-   *   field columns of this table mapping.
+   *   The field storage definitions for which to create the table mapping.
+   * @param \Drupal\Core\Field\FieldDefinitionInterface[] $base_field_definitions
+   *   The base field definitions for which to create the table mapping.
    */
-  public function __construct(array $storage_definitions) {
+  public function __construct(array $storage_definitions, array $base_field_definitions) {
     $this->fieldStorageDefinitions = $storage_definitions;
+    $this->baseFieldDefinitions = $base_field_definitions;
   }
 
   /**
@@ -101,7 +110,16 @@ public function getAllColumns($table_name) {
         $this->allColumns[$table_name] = array_merge($this->allColumns[$table_name], array_values($this->getColumnNames($field_name)));
       }
 
-      $this->allColumns[$table_name] = array_merge($this->allColumns[$table_name], $this->getExtraColumns($table_name));
+      // There is just one field for each dedicated storage table, thus
+      // $field_name can only refer to it.
+      if (isset($field_name) && $this->requiresDedicatedTableStorage($this->fieldStorageDefinitions[$field_name])) {
+        // Unlike in shared storage tables, in dedicated ones field columns are
+        // positioned last.
+        $this->allColumns[$table_name] = array_merge($this->getExtraColumns($table_name), $this->allColumns[$table_name]);
+      }
+      else {
+        $this->allColumns[$table_name] = array_merge($this->allColumns[$table_name], $this->getExtraColumns($table_name));
+      }
     }
     return $this->allColumns[$table_name];
   }
@@ -180,6 +198,47 @@ public function setExtraColumns($table_name, array $column_names) {
   }
 
   /**
+   * Checks whether the given field can be stored in a shared table.
+   *
+   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition
+   *   The field storage definition.
+   *
+   * @return bool
+   *   TRUE if the field can be stored in a dedicated table, FALSE otherwise.
+   */
+  public function allowsSharedTableStorage(FieldStorageDefinitionInterface $storage_definition) {
+     return !$storage_definition->hasCustomStorage() && isset($this->baseFieldDefinitions[$storage_definition->getName()]) && !$storage_definition->isMultiple();
+  }
+
+  /**
+   * Checks whether the given field has to be stored in a dedicated table.
+   *
+   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition
+   *   The field storage definition.
+   *
+   * @return bool
+   *   TRUE if the field can be stored in a dedicated table, FALSE otherwise.
+   */
+  public function requiresDedicatedTableStorage(FieldStorageDefinitionInterface $storage_definition) {
+    return !$storage_definition->hasCustomStorage() && !$this->allowsSharedTableStorage($storage_definition);
+  }
+
+  /**
+   * Returns a list of dedicated table names for this mapping.
+   *
+   * @return string[]
+   *   An array of table names.
+   */
+  public function getDedicatedTableNames() {
+    $table_mapping = $this;
+    $definitions = array_filter($this->fieldStorageDefinitions, function($definition) use ($table_mapping) { return $table_mapping->requiresDedicatedTableStorage($definition); });
+    $data_tables = array_map(function($definition) use ($table_mapping) { return $table_mapping->getDedicatedDataTableName($definition); }, $definitions);
+    $revision_tables = array_map(function($definition) use ($table_mapping) { return $table_mapping->getDedicatedRevisionTableName($definition); }, $definitions);
+    $dedicated_tables = array_merge(array_values($data_tables), array_values($revision_tables));
+    return $dedicated_tables;
+  }
+
+  /**
    * {@inheritdoc}
    */
   public function getReservedColumns() {
diff --git a/core/lib/Drupal/Core/Entity/Sql/SqlEntityStorageInterface.php b/core/lib/Drupal/Core/Entity/Sql/SqlEntityStorageInterface.php
index 107ed26..984d05e 100644
--- a/core/lib/Drupal/Core/Entity/Sql/SqlEntityStorageInterface.php
+++ b/core/lib/Drupal/Core/Entity/Sql/SqlEntityStorageInterface.php
@@ -8,19 +8,22 @@
 namespace Drupal\Core\Entity\Sql;
 
 use Drupal\Core\Entity\EntityStorageInterface;
-use Drupal\Core\Entity\Schema\EntitySchemaProviderInterface;
 
 /**
  * A common interface for SQL-based entity storage implementations.
  */
-interface SqlEntityStorageInterface extends EntityStorageInterface, EntitySchemaProviderInterface {
+interface SqlEntityStorageInterface extends EntityStorageInterface {
 
   /**
    * Gets a table mapping for the entity's SQL tables.
    *
+   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface[] $storage_definitions
+   *   (optional) An array of field storage definitions to be used to compute
+   *   the table mapping. Defaults to the ones provided by the entity manager.
+   *
    * @return \Drupal\Core\Entity\Sql\TableMappingInterface
    *   A table mapping object for the entity's tables.
    */
-  public function getTableMapping();
+  public function getTableMapping(array $storage_definitions = NULL);
 
 }
diff --git a/core/lib/Drupal/Core/Extension/ModuleHandler.php b/core/lib/Drupal/Core/Extension/ModuleHandler.php
index aa36d42..3acfd91 100644
--- a/core/lib/Drupal/Core/Extension/ModuleHandler.php
+++ b/core/lib/Drupal/Core/Extension/ModuleHandler.php
@@ -12,7 +12,7 @@
 use Drupal\Component\Utility\NestedArray;
 use Drupal\Component\Utility\String;
 use Drupal\Core\Cache\CacheBackendInterface;
-use Drupal\Core\Entity\Schema\EntitySchemaProviderInterface;
+use Drupal\Core\Entity\ContentEntityTypeInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -845,19 +845,12 @@ public function install(array $module_list, $enable_dependencies = TRUE) {
         }
         drupal_set_installed_schema_version($module, $version);
 
-        // Install any entity schemas belonging to the module.
+        // Notify the entity manager that this module's entity types are new,
+        // so that it can install its schemas or whatever else is needed.
         $entity_manager = \Drupal::entityManager();
-        $schema = \Drupal::database()->schema();
         foreach ($entity_manager->getDefinitions() as $entity_type) {
           if ($entity_type->getProvider() == $module) {
-            $storage = $entity_manager->getStorage($entity_type->id());
-            if ($storage instanceof EntitySchemaProviderInterface) {
-              foreach ($storage->getSchema() as $table_name => $table_schema) {
-                if (!$schema->tableExists($table_name)) {
-                  $schema->createTable($table_name, $table_schema);
-                }
-              }
-            }
+            $entity_manager->onEntityTypeCreate($entity_type);
           }
         }
 
@@ -965,19 +958,12 @@ public function uninstall(array $module_list, $uninstall_dependents = TRUE) {
       // Remove all configuration belonging to the module.
       \Drupal::service('config.manager')->uninstall('module', $module);
 
-      // Remove any entity schemas belonging to the module.
-
-      $schema = \Drupal::database()->schema();
+      // Notify the entity manager that this module's entity types are being
+      // deleted, so that it can uninstall its schemas or whatever else is
+      // needed.
       foreach ($entity_manager->getDefinitions() as $entity_type) {
         if ($entity_type->getProvider() == $module) {
-          $storage = $entity_manager->getStorage($entity_type->id());
-          if ($storage instanceof EntitySchemaProviderInterface) {
-            foreach ($storage->getSchema() as $table_name => $table_schema) {
-              if ($schema->tableExists($table_name)) {
-                $schema->dropTable($table_name);
-              }
-            }
-          }
+          $entity_manager->onEntityTypeDelete($entity_type);
         }
       }
 
diff --git a/core/lib/Drupal/Core/Field/BaseFieldDefinition.php b/core/lib/Drupal/Core/Field/BaseFieldDefinition.php
index 20b31ad..e4a4406 100644
--- a/core/lib/Drupal/Core/Field/BaseFieldDefinition.php
+++ b/core/lib/Drupal/Core/Field/BaseFieldDefinition.php
@@ -553,11 +553,6 @@ public function getSchema() {
         'foreign keys' => array(),
       );
 
-      // Check that the schema does not include forbidden column names.
-      if (array_intersect(array_keys($schema['columns']), static::getReservedColumns())) {
-        throw new FieldException('Illegal field type columns.');
-      }
-
       // Merge custom indexes with those specified by the field type. Custom
       // indexes prevail.
       $schema['indexes'] = $this->indexes + $schema['indexes'];
@@ -583,15 +578,6 @@ public function getColumns() {
   }
 
   /**
-   * A list of columns that can not be used as field type columns.
-   *
-   * @return array
-   */
-  public static function getReservedColumns() {
-    return array('deleted');
-  }
-
-  /**
    * {@inheritdoc}
    */
   public function hasCustomStorage() {
diff --git a/core/lib/Drupal/Core/Field/FieldStorageDefinitionListenerInterface.php b/core/lib/Drupal/Core/Field/FieldStorageDefinitionListenerInterface.php
new file mode 100644
index 0000000..fcea2e4
--- /dev/null
+++ b/core/lib/Drupal/Core/Field/FieldStorageDefinitionListenerInterface.php
@@ -0,0 +1,46 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\Field\FieldStorageDefinitionListenerInterface.
+ */
+
+namespace Drupal\Core\Field;
+
+/**
+ * Defines an interface for reacting to field storage definition creation, deletion, and updates.
+ *
+ * @todo Convert to Symfony events: https://www.drupal.org/node/2332935
+ */
+interface FieldStorageDefinitionListenerInterface {
+
+  /**
+   * Reacts to the creation of a field storage definition.
+   *
+   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition
+   *   The definition being created.
+   */
+  public function onFieldStorageDefinitionCreate(FieldStorageDefinitionInterface $storage_definition);
+
+  /**
+   * Reacts to the update of a field storage definition.
+   *
+   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition
+   *   The field being updated.
+   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $original
+   *   The original storage definition; i.e., the definition before the update.
+   *
+   * @throws \Drupal\Core\Entity\Exception\FieldStorageDefinitionUpdateForbiddenException
+   *   Thrown when the update to the field is forbidden.
+   */
+  public function onFieldStorageDefinitionUpdate(FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original);
+
+  /**
+   * Reacts to the deletion of a field storage definition.
+   *
+   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition
+   *   The field being deleted.
+   */
+  public function onFieldStorageDefinitionDelete(FieldStorageDefinitionInterface $storage_definition);
+
+}
diff --git a/core/modules/contact/tests/modules/contact_storage_test/contact_storage_test.install b/core/modules/contact/tests/modules/contact_storage_test/contact_storage_test.install
index bcbe5df..c56d5b5 100644
--- a/core/modules/contact/tests/modules/contact_storage_test/contact_storage_test.install
+++ b/core/modules/contact/tests/modules/contact_storage_test/contact_storage_test.install
@@ -9,16 +9,15 @@
  * Implements hook_install().
  */
 function contact_storage_test_install() {
-  // ModuleHandler won't create the schema automatically because Message entity
-  // belongs to contact.module.
-  // @todo Remove this when https://www.drupal.org/node/1498720 is in.
   $entity_manager = \Drupal::entityManager();
-  $schema = \Drupal::database()->schema();
   $entity_type = $entity_manager->getDefinition('contact_message');
-  $storage = $entity_manager->getStorage($entity_type->id());
-  foreach ($storage->getSchema() as $table_name => $table_schema) {
-    if (!$schema->tableExists($table_name)) {
-      $schema->createTable($table_name, $table_schema);
-    }
-  }
+
+  // Recreate the original entity type definition, in order to notify the
+  // manager of what changed. The change of storage backend will trigger
+  // schema installation.
+  // @see contact_storage_test_entity_type_alter()
+  $original = clone $entity_type;
+  $original->setStorageClass('Drupal\Core\Entity\ContentEntityNullStorage');
+
+  $entity_manager->onEntityTypeUpdate($entity_type, $original);
 }
diff --git a/core/modules/contact/tests/modules/contact_storage_test/contact_storage_test.module b/core/modules/contact/tests/modules/contact_storage_test/contact_storage_test.module
index 3ef9d22..e3352c4 100644
--- a/core/modules/contact/tests/modules/contact_storage_test/contact_storage_test.module
+++ b/core/modules/contact/tests/modules/contact_storage_test/contact_storage_test.module
@@ -13,15 +13,11 @@
 function contact_storage_test_entity_base_field_info(\Drupal\Core\Entity\EntityTypeInterface $entity_type) {
   if ($entity_type->id() == 'contact_message') {
     $fields = array();
+
     $fields['id'] = BaseFieldDefinition::create('integer')
       ->setLabel(t('Message ID'))
       ->setDescription(t('The message ID.'))
       ->setReadOnly(TRUE)
-      // Explicitly set this to 'contact' so that
-      // ContentEntityDatabaseStorage::usesDedicatedTable() doesn't attempt to
-      // put the ID in a dedicated table.
-      // @todo Remove when https://www.drupal.org/node/1498720 is in.
-      ->setProvider('contact')
       ->setSetting('unsigned', TRUE);
 
     return $fields;
diff --git a/core/modules/field/src/Entity/FieldStorageConfig.php b/core/modules/field/src/Entity/FieldStorageConfig.php
index f6953b3..5931f36 100644
--- a/core/modules/field/src/Entity/FieldStorageConfig.php
+++ b/core/modules/field/src/Entity/FieldStorageConfig.php
@@ -290,8 +290,8 @@ protected function preSaveNew(EntityStorageInterface $storage) {
     // definition is passed to the various hooks and written to config.
      $this->settings += $field_type_manager->getDefaultSettings($this->type);
 
-    // Notify the entity storage.
-    $entity_manager->getStorage($this->entity_type)->onFieldStorageDefinitionCreate($this);
+    // Notify the entity manager.
+    $entity_manager->onFieldStorageDefinitionCreate($this);
   }
 
   /**
@@ -334,10 +334,10 @@ protected function preSaveUpdated(EntityStorageInterface $storage) {
     // invokes hook_field_storage_config_update_forbid().
     $module_handler->invokeAll('field_storage_config_update_forbid', array($this, $this->original));
 
-    // Notify the storage. The controller can reject the definition
+    // Notify the entity manager. A listener can reject the definition
     // update as invalid by raising an exception, which stops execution before
     // the definition is written to config.
-    $entity_manager->getStorage($this->entity_type)->onFieldStorageDefinitionUpdate($this, $this->original);
+    $entity_manager->onFieldStorageDefinitionUpdate($this, $this->original);
   }
 
   /**
@@ -406,7 +406,7 @@ public static function postDelete(EntityStorageInterface $storage, array $fields
     // Notify the storage.
     foreach ($fields as $field) {
       if (!$field->deleted) {
-        \Drupal::entityManager()->getStorage($field->entity_type)->onFieldStorageDefinitionDelete($field);
+        \Drupal::entityManager()->onFieldStorageDefinitionDelete($field);
         $field->deleted = TRUE;
       }
     }
diff --git a/core/modules/simpletest/src/KernelTestBase.php b/core/modules/simpletest/src/KernelTestBase.php
index 4ef5e10..314dff6 100644
--- a/core/modules/simpletest/src/KernelTestBase.php
+++ b/core/modules/simpletest/src/KernelTestBase.php
@@ -11,10 +11,11 @@
 use Drupal\Core\Database\Database;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\DrupalKernel;
+use Drupal\Core\Entity\EntityTypeListenerInterface;
+use Drupal\Core\Entity\Sql\SqlEntityStorageInterface;
 use Drupal\Core\KeyValueStore\KeyValueMemoryFactory;
 use Drupal\Core\Language\Language;
 use Drupal\Core\Site\Settings;
-use Drupal\Core\Entity\Schema\EntitySchemaProviderInterface;
 use Symfony\Component\DependencyInjection\Parameter;
 use Symfony\Component\DependencyInjection\Reference;
 use Symfony\Component\HttpFoundation\Request;
@@ -388,24 +389,15 @@ protected function installSchema($module, $tables) {
   protected function installEntitySchema($entity_type_id) {
     /** @var \Drupal\Core\Entity\EntityManagerInterface $entity_manager */
     $entity_manager = $this->container->get('entity.manager');
-    /** @var \Drupal\Core\Database\Schema $schema_handler */
-    $schema_handler = $this->container->get('database')->schema();
+    $entity_type = $entity_manager->getDefinition($entity_type_id);
+    $entity_manager->onEntityTypeCreate($entity_type);
 
     $storage = $entity_manager->getStorage($entity_type_id);
-    if ($storage instanceof EntitySchemaProviderInterface) {
-      $schema = $storage->getSchema();
-      foreach ($schema as $table_name => $table_schema) {
-        $schema_handler->createTable($table_name, $table_schema);
-      }
-
+    if ($storage instanceof SqlEntityStorageInterface && $storage instanceof EntityTypeListenerInterface) {
+      $table_mapping = $storage->getTableMapping();
       $this->pass(String::format('Installed entity type tables for the %entity_type entity type: %tables', array(
         '%entity_type' => $entity_type_id,
-        '%tables' => '{' . implode('}, {', array_keys($schema)) . '}',
-      )));
-    }
-    else {
-      throw new \RuntimeException(String::format('Entity type %entity_type does not support automatic schema installation.', array(
-        '%entity-type' => $entity_type_id,
+        '%tables' => '{' . implode('}, {', $table_mapping->getTableNames()) . '}',
       )));
     }
   }
diff --git a/core/modules/system/src/Controller/DbUpdateController.php b/core/modules/system/src/Controller/DbUpdateController.php
index 62752ae..7b84a54 100644
--- a/core/modules/system/src/Controller/DbUpdateController.php
+++ b/core/modules/system/src/Controller/DbUpdateController.php
@@ -130,9 +130,14 @@ public function handle($op, Request $request) {
     }
     else {
       switch ($op) {
+        case 'entity_schema':
+          $regions['sidebar_first'] = $this->updateTasksList('entity_schema');
+          $output = $this->entitySchema();
+          break;
+
         case 'selection':
           $regions['sidebar_first'] = $this->updateTasksList('selection');
-          $output = $this->selection();
+          $output = $this->selection($request);
           break;
 
         case 'run':
@@ -162,7 +167,7 @@ public function handle($op, Request $request) {
     if ($output instanceof Response) {
       return $output;
     }
-    $title = isset($output['#title']) ? $output['#title'] : $this->t('Drupal database update');
+    $title = isset($output['#title']) ? $output['#title'] : $this->t('Drupal module updates');
 
     return new Response(DefaultHtmlPageRenderer::renderPage($output, $title, 'maintenance', $regions));
   }
@@ -199,22 +204,66 @@ protected function info() {
       '#markup' => '<p>' . $this->t('When you have performed the steps above, you may proceed.') . '</p>',
     );
 
-    $url = new Url('system.db_update', array('op' => 'selection'));
+    $entity_schema_updates = count(\Drupal::service('entity.schema.manager')->getChangeList());
+    $url = new Url('system.db_update', array('op' => ($entity_schema_updates ? 'entity_schema' : 'selection')));
+    $build['link'] = array(
+      '#type' => 'link',
+      '#title' => $this->t('Continue'),
+      '#attributes' => array('class' => array('button', 'button--primary')),
+    ) + $url->toRenderArray();
+    return $build;
+  }
+
+  /**
+   * Renders a list of available entity schema updates.
+   *
+   * @return array
+   *   A render array.
+   */
+  function entitySchema() {
+    $build = array('#title' => $this->t('Drupal entity schema updates'));
+
+    // Build a summary of the entity schema changes.
+    $summary = \Drupal::service('entity.schema.manager')->getChangeSummary();
+    if ($summary) {
+      $entity_manager = $this->entityManager();
+      foreach ($summary as $entity_type_id => $items) {
+        $definition = $entity_manager->getDefinition($entity_type_id);
+        $build['summary'][$entity_type_id] = array(
+          '#type' => 'details',
+          '#title' => $definition->getLabel(),
+        );
+        $build['summary'][$entity_type_id]['changes'] = array(
+          '#theme' => 'item_list',
+          '#items' => $items,
+        );
+      }
+    }
+    else {
+      $build['summary'] = array('#markup' => $this->t('No entity schema changes available.'));
+    }
+
+    $url = new Url('system.db_update', array('op' => 'selection'), array('query' => array('entity_schema_updates' => (int) !empty($summary))));
     $build['link'] = array(
       '#type' => 'link',
       '#title' => $this->t('Continue'),
       '#attributes' => array('class' => array('button', 'button--primary')),
+      '#weight' => 5,
     ) + $url->toRenderArray();
+
     return $build;
   }
 
   /**
-   * Renders a list of available database updates.
+   * Renders a list of available module updates.
+   *
+   * @param \Symfony\Component\HttpFoundation\Request $request
+   *   The current request object.
    *
    * @return array
    *   A render array.
    */
-  protected function selection() {
+  protected function selection(Request $request) {
     // Make sure there is no stale theme registry.
     $this->cache->deleteAll();
 
@@ -285,7 +334,8 @@ protected function selection() {
       drupal_set_message($this->t('Some of the pending updates cannot be applied because their dependencies were not met.'), 'warning');
     }
 
-    if (empty($count)) {
+    $force_updates = (bool) $request->get('entity_schema_updates');
+    if (empty($count) && !$force_updates) {
       drupal_set_message($this->t('No pending updates.'));
       unset($build);
       $build['links'] = array(
@@ -297,21 +347,31 @@ protected function selection() {
       drupal_flush_all_caches();
     }
     else {
-      $build['help'] = array(
-        '#markup' => '<p>' . $this->t('The version of Drupal you are updating from has been automatically detected.') . '</p>',
-        '#weight' => -5,
-      );
-      if ($incompatible_count) {
-        $build['start']['#title'] = $this->formatPlural(
-          $count,
-          '1 pending update (@number_applied to be applied, @number_incompatible skipped)',
-          '@count pending updates (@number_applied to be applied, @number_incompatible skipped)',
-          array('@number_applied' => $count - $incompatible_count, '@number_incompatible' => $incompatible_count)
+      if ($count > 0) {
+        $build['help'] = array(
+          '#markup' => '<p>' . $this->t('The version of Drupal you are updating from has been automatically detected.') . '</p>',
+          '#weight' => -5,
         );
+        if ($incompatible_count) {
+          $build['start']['#title'] = $this->formatPlural(
+            $count,
+            '1 pending update (@number_applied to be applied, @number_incompatible skipped)',
+            '@count pending updates (@number_applied to be applied, @number_incompatible skipped)',
+            array('@number_applied' => $count - $incompatible_count, '@number_incompatible' => $incompatible_count)
+          );
+        }
+        else {
+          $build['start']['#title'] = $this->formatPlural($count, '1 pending update', '@count pending updates');
+        }
       }
       else {
-        $build['start']['#title'] = $this->formatPlural($count, '1 pending update', '@count pending updates');
+        unset($build);
+        $build['help'] = array(
+          '#markup' => '<p>No module update available.</p>',
+          '#weight' => -5,
+        );
       }
+
       $url = new Url('system.db_update', array('op' => 'run'));
       $build['link'] = array(
         '#type' => 'link',
@@ -471,7 +531,8 @@ protected function updateTasksList($active = NULL) {
     $tasks = array(
       'requirements' => $this->t('Verify requirements'),
       'info' => $this->t('Overview'),
-      'selection' => $this->t('Review updates'),
+      'entity_schema' => $this->t('Review entity schema updates'),
+      'selection' => $this->t('Review module updates'),
       'run' => $this->t('Run updates'),
       'results' => $this->t('Review log'),
     );
@@ -501,9 +562,16 @@ protected function triggerBatch(Request $request) {
       $this->state->set('system.maintenance_mode', TRUE);
     }
 
-    $start = $this->getModuleUpdates();
+    // First of all perform entity schema updates, if needed, so that subsequent
+    // updates work with a correct entity schema.
+    $operations = array();
+    if (\Drupal::service('entity.schema.manager')->getChangeList()) {
+      $operations[] = array('update_entity_schema', array('system', '0 - Update entity schema'));
+    }
+
     // Resolve any update dependencies to determine the actual updates that will
     // be run and the order they will be run in.
+    $start = $this->getModuleUpdates();
     $updates = update_resolve_dependencies($start);
 
     // Store the dependencies for each update function in an array which the
@@ -515,7 +583,7 @@ protected function triggerBatch(Request $request) {
       $dependency_map[$function] = !empty($update['reverse_paths']) ? array_keys($update['reverse_paths']) : array();
     }
 
-    $operations = array();
+    // Determine updates to be performed.
     foreach ($updates as $update) {
       if ($update['allowed']) {
         // Set the installed version of each module so updates will start at the
diff --git a/core/modules/system/src/Tests/Entity/EntityBundleFieldTest.php b/core/modules/system/src/Tests/Entity/EntityBundleFieldTest.php
index 755527b..02c082e 100644
--- a/core/modules/system/src/Tests/Entity/EntityBundleFieldTest.php
+++ b/core/modules/system/src/Tests/Entity/EntityBundleFieldTest.php
@@ -40,58 +40,40 @@ protected function setUp() {
   }
 
   /**
-   * Tests the custom bundle field creation and deletion.
-   */
-  public function testCustomBundleFieldCreateDelete() {
-    // Install the module which adds the field.
-    $this->moduleHandler->install(array('entity_bundle_field_test'), FALSE);
-    $definition = $this->entityManager->getFieldDefinitions('entity_test', 'custom')['custom_field'];
-    $this->assertNotNull($definition, 'Field definition found.');
-
-    // Make sure the table has been created.
-    /** @var \Drupal\Core\Entity\Sql\DefaultTableMapping $table_mapping */
-    $table_mapping = $this->entityManager->getStorage('entity_test')->getTableMapping();
-    $table = $table_mapping->getDedicatedDataTableName($definition);
-    $this->assertTrue($this->database->schema()->tableExists($table), 'Table created');
-    $this->moduleHandler->uninstall(array('entity_bundle_field_test'), FALSE);
-    $this->assertFalse($this->database->schema()->tableExists($table), 'Table dropped');
-  }
-
-  /**
    * Tests making use of a custom bundle field.
    */
   public function testCustomBundleFieldUsage() {
     // Check that an entity with bundle entity_test does not have the custom
     // field.
-    $this->moduleHandler->install(array('entity_bundle_field_test'), FALSE);
+    $this->moduleHandler->install(array('entity_schema_test'), FALSE);
     $storage = $this->entityManager->getStorage('entity_test');
     $entity = $storage->create([
       'type' => 'entity_test',
     ]);
-    $this->assertFalse($entity->hasField('custom_field'));
+    $this->assertFalse($entity->hasField('custom_bundle_field'));
 
     // Check that the custom bundle has the defined custom field and check
     // saving and deleting of custom field data.
     $entity = $storage->create([
       'type' => 'custom',
     ]);
-    $this->assertTrue($entity->hasField('custom_field'));
-    $entity->custom_field->value = 'swanky';
+    $this->assertTrue($entity->hasField('custom_bundle_field'));
+    $entity->custom_bundle_field->value = 'swanky';
     $entity->save();
     $storage->resetCache();
     $entity = $storage->load($entity->id());
-    $this->assertEqual($entity->custom_field->value, 'swanky', 'Entity was saved correct.y');
+    $this->assertEqual($entity->custom_bundle_field->value, 'swanky', 'Entity was saved correct.y');
 
-    $entity->custom_field->value = 'cozy';
+    $entity->custom_bundle_field->value = 'cozy';
     $entity->save();
     $storage->resetCache();
     $entity = $storage->load($entity->id());
-    $this->assertEqual($entity->custom_field->value, 'cozy', 'Entity was updated correctly.');
+    $this->assertEqual($entity->custom_bundle_field->value, 'cozy', 'Entity was updated correctly.');
 
     $entity->delete();
     /** @var \Drupal\Core\Entity\Sql\DefaultTableMapping $table_mapping */
     $table_mapping = $storage->getTableMapping();
-    $table = $table_mapping->getDedicatedDataTableName($entity->getFieldDefinition('custom_field'));
+    $table = $table_mapping->getDedicatedDataTableName($entity->getFieldDefinition('custom_bundle_field'));
     $result = $this->database->select($table, 'f')
       ->fields('f')
       ->condition('f.entity_id', $entity->id())
@@ -100,11 +82,11 @@ public function testCustomBundleFieldUsage() {
 
     // Create another entity to test that values are marked as deleted when a
     // bundle is deleted.
-    $entity = $storage->create(['type' => 'custom', 'custom_field' => 'new']);
+    $entity = $storage->create(['type' => 'custom', 'custom_bundle_field' => 'new']);
     $entity->save();
     entity_test_delete_bundle('custom');
 
-    $table = $table_mapping->getDedicatedDataTableName($entity->getFieldDefinition('custom_field'));
+    $table = $table_mapping->getDedicatedDataTableName($entity->getFieldDefinition('custom_bundle_field'));
     $result = $this->database->select($table, 'f')
       ->condition('f.entity_id', $entity->id())
       ->condition('deleted', 1)
@@ -112,7 +94,8 @@ public function testCustomBundleFieldUsage() {
       ->execute();
     $this->assertEqual(1, $result->fetchField(), 'Field data has been deleted');
 
-    // @todo Test field purge and table deletion once supported.
+    // @todo Test field purge and table deletion once supported. See
+    //   https://www.drupal.org/node/2282119.
     // $this->assertFalse($this->database->schema()->tableExists($table), 'Custom field table was deleted');
   }
 
diff --git a/core/modules/system/src/Tests/Entity/EntitySchemaTest.php b/core/modules/system/src/Tests/Entity/EntitySchemaTest.php
new file mode 100644
index 0000000..2a35c36
--- /dev/null
+++ b/core/modules/system/src/Tests/Entity/EntitySchemaTest.php
@@ -0,0 +1,168 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\system\Tests\Entity\EntitySchemaTest.
+ */
+
+namespace Drupal\system\Tests\Entity;
+
+use Drupal\Component\Utility\String;
+
+/**
+ * Tests adding a custom bundle field.
+ */
+class EntitySchemaTest extends EntityUnitTestBase  {
+
+  /**
+   * The module handler.
+   *
+   * @var \Drupal\Core\Extension\ModuleHandlerInterface
+   */
+  protected $moduleHandler;
+
+  /**
+   * The database connection used.
+   *
+   * @var \Drupal\Core\Database\Connection
+   */
+  protected $database;
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = array('menu_link');
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function getInfo() {
+    return array(
+      'name' => 'Entity Schema',
+      'description' => 'Tests entity field schema API for base and bundle fields.',
+      'group' => 'Entity API',
+    );
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function setUp() {
+    parent::setUp();
+    $this->installSchema('user', array('users_data'));
+    $this->installSchema('system', array('router'));
+    $this->moduleHandler = $this->container->get('module_handler');
+    $this->database = $this->container->get('database');
+  }
+
+  /**
+   * Tests the custom bundle field creation and deletion.
+   */
+  public function testCustomFieldCreateDelete() {
+    // Install the module which adds the field.
+    $this->installModule('entity_schema_test');
+    $this->entityManager->clearCachedDefinitions();
+    $definition = $this->entityManager->getBaseFieldDefinitions('entity_test')['custom_base_field'];
+    $this->assertNotNull($definition, 'Base field definition found.');
+    $definition = $this->entityManager->getFieldDefinitions('entity_test', 'custom')['custom_bundle_field'];
+    $this->assertNotNull($definition, 'Bundle field definition found.');
+
+    // Make sure the field schema has been created.
+    /** @var \Drupal\Core\Entity\Sql\DefaultTableMapping $table_mapping */
+    $table_mapping = $this->entityManager->getStorage('entity_test')->getTableMapping();
+    $base_table = current($table_mapping->getTableNames());
+    $base_column = current($table_mapping->getColumnNames('custom_base_field'));
+    $this->assertTrue($this->database->schema()->fieldExists($base_table, $base_column), 'Table column created');
+
+    $table = $table_mapping->getDedicatedDataTableName($definition->getFieldStorageDefinition());
+    $this->assertTrue($this->database->schema()->tableExists($table), 'Table created');
+    $this->uninstallModule('entity_schema_test');
+    $this->assertFalse($this->database->schema()->fieldExists($base_table, $base_column), 'Table column dropped');
+    $this->assertFalse($this->database->schema()->tableExists($table), 'Table dropped');
+  }
+
+  /**
+   * Tests that entity schema responds to changes in the entity type definition.
+   */
+  public function testEntitySchemaUpdate() {
+    $this->installModule('entity_schema_test');
+    $schema_handler = $this->database->schema();
+    $tables = array('entity_test', 'entity_test_revision', 'entity_test_field_data', 'entity_test_field_revision');
+    $dedicated_tables = array('entity_test__custom_bundle_field', 'entity_test_revision__custom_bundle_field');
+
+    // Initially only the base table and the field data tables should exist.
+    foreach ($tables as $index => $table) {
+      $this->assertEqual($schema_handler->tableExists($table), !$index, String::format('Entity schema correct for the @table table.', array('@table' => $table)));
+    }
+    $this->assertTrue($schema_handler->tableExists($dedicated_tables[0]), String::format('Field schema correct for the @table table.', array('@table' => $table)));
+
+    // Update the entity type definition and check that the entity schema now
+    // supports translations and revisions.
+    $this->updateEntityType(TRUE);
+    foreach ($tables as $table) {
+      $this->assertTrue($schema_handler->tableExists($table), String::format('Entity schema correct for the @table table.', array('@table' => $table)));
+    }
+    foreach ($dedicated_tables as $table) {
+      $this->assertTrue($schema_handler->tableExists($table), String::format('Field schema correct for the @table table.', array('@table' => $table)));
+    }
+
+    // Revert changes and check that the entity schema now does not support
+    // neither translations nor revisions.
+    $this->updateEntityType(FALSE);
+    foreach ($tables as $index => $table) {
+      $this->assertEqual($schema_handler->tableExists($table), !$index, String::format('Entity schema correct for the @table table.', array('@table' => $table)));
+    }
+    $this->assertTrue($schema_handler->tableExists($dedicated_tables[0]), String::format('Field schema correct for the @table table.', array('@table' => $table)));
+  }
+
+  /**
+   * Updates the entity type definition.
+   *
+   * @param bool $alter
+   *   Whether the original definition should be altered or not.
+   */
+  protected function updateEntityType($alter) {
+    $entity_test_id = 'entity_test';
+    $original = $this->entityManager->getDefinition($entity_test_id);
+    $this->entityManager->clearCachedDefinitions();
+    $this->state->set('entity_schema_update', $alter);
+    $altered = $this->entityManager->getDefinition($entity_test_id);
+    $this->entityManager->onEntityTypeUpdate($altered, $original);
+  }
+
+  /**
+   * Installs a module and refreshes services.
+   *
+   * @param string $module
+   *   The module to install.
+   */
+  protected function installModule($module) {
+    $this->moduleHandler->install(array($module), FALSE);
+    $this->refreshServices();
+  }
+
+  /**
+   * Uninstalls a module and refreshes services.
+   *
+   * @param string $module
+   *   The module to uninstall.
+   */
+  protected function uninstallModule($module) {
+    $this->moduleHandler->uninstall(array($module), FALSE);
+    $this->refreshServices();
+  }
+
+  /**
+   * Refresh services.
+   */
+  protected function refreshServices() {
+    $this->container = \Drupal::getContainer();
+    $this->moduleHandler = $this->container->get('module_handler');
+    $this->database = $this->container->get('database');
+    $this->entityManager = $this->container->get('entity.manager');
+    $this->state = $this->container->get('state');
+  }
+
+}
diff --git a/core/modules/system/src/Tests/Entity/FieldSqlStorageTest.php b/core/modules/system/src/Tests/Entity/FieldSqlStorageTest.php
index d3df71c..9c3a870 100644
--- a/core/modules/system/src/Tests/Entity/FieldSqlStorageTest.php
+++ b/core/modules/system/src/Tests/Entity/FieldSqlStorageTest.php
@@ -8,7 +8,6 @@
 namespace Drupal\system\Tests\Entity;
 
 use Drupal\Core\Database\Database;
-use Drupal\Core\Entity\ContentEntityDatabaseStorage;
 use Drupal\Core\Entity\Exception\FieldStorageDefinitionUpdateForbiddenException;
 use Drupal\field\Entity\FieldStorageConfig;
 
@@ -460,19 +459,9 @@ function testFieldSqlStorageForeignKeys() {
     // Reload the field schema after the update.
     $schema = $field_storage->getSchema();
 
-    // Retrieve the field definition and check that the foreign key is in place.
-    $field_storage = FieldStorageConfig::loadByName('entity_test', $field_name);
+    // Check that the foreign key is in place.
     $this->assertEqual($schema['foreign keys'][$foreign_key_name]['table'], $foreign_key_name, 'Foreign key table name modified after update');
     $this->assertEqual($schema['foreign keys'][$foreign_key_name]['columns'][$foreign_key_name], 'id', 'Foreign key column name modified after update');
-
-    // Verify the SQL schema.
-    $schemas = ContentEntityDatabaseStorage::_fieldSqlSchema($field_storage);
-    $schema = $schemas[$this->table_mapping->getDedicatedDataTableName($field_storage)];
-    $this->assertEqual(count($schema['foreign keys']), 1, 'There is 1 foreign key in the schema');
-    $foreign_key = reset($schema['foreign keys']);
-    $foreign_key_column = $this->table_mapping->getFieldColumnName($field_storage, $foreign_key_name);
-    $this->assertEqual($foreign_key['table'], $foreign_key_name, 'Foreign key table name preserved in the schema');
-    $this->assertEqual($foreign_key['columns'][$foreign_key_column], 'id', 'Foreign key column name preserved in the schema');
   }
 
   /**
diff --git a/core/modules/system/src/Tests/Entity/FieldTranslationSqlStorageTest.php b/core/modules/system/src/Tests/Entity/FieldTranslationSqlStorageTest.php
index 2874aed..c2a6a65 100644
--- a/core/modules/system/src/Tests/Entity/FieldTranslationSqlStorageTest.php
+++ b/core/modules/system/src/Tests/Entity/FieldTranslationSqlStorageTest.php
@@ -87,24 +87,19 @@ protected function assertFieldStorageLangcode(ContentEntityInterface $entity, $m
 
     foreach ($fields as $field_name) {
       $field_storage = FieldStorageConfig::loadByName($entity_type, $field_name);
-      $tables = array(
-        $table_mapping->getDedicatedDataTableName($field_storage),
-        $table_mapping->getDedicatedRevisionTableName($field_storage),
-      );
+      $table = $table_mapping->getDedicatedDataTableName($field_storage);
 
-      foreach ($tables as $table) {
-        $record = \Drupal::database()
-          ->select($table, 'f')
-          ->fields('f')
-          ->condition('f.entity_id', $id)
-          ->condition('f.revision_id', $id)
-          ->execute()
-          ->fetchObject();
+      $record = \Drupal::database()
+        ->select($table, 'f')
+        ->fields('f')
+        ->condition('f.entity_id', $id)
+        ->condition('f.revision_id', $id)
+        ->execute()
+        ->fetchObject();
 
-        if ($record->langcode != $langcode) {
-          $status = FALSE;
-          break;
-        }
+      if ($record->langcode != $langcode) {
+        $status = FALSE;
+        break;
       }
     }
 
diff --git a/core/modules/system/system.install b/core/modules/system/system.install
index 8e7b534..9b7e901 100644
--- a/core/modules/system/system.install
+++ b/core/modules/system/system.install
@@ -452,6 +452,9 @@ function system_requirements($phase) {
         }
       }
     }
+
+    // Check entity schema status.
+    $requirements['entity_schema'] = \Drupal::service('entity.schema.manager')->getSystemRequirements($phase);
   }
 
   // Verify the update.php access setting
diff --git a/core/modules/system/tests/modules/entity_bundle_field_test/entity_bundle_field_test.info.yml b/core/modules/system/tests/modules/entity_bundle_field_test/entity_bundle_field_test.info.yml
deleted file mode 100644
index 6732090..0000000
--- a/core/modules/system/tests/modules/entity_bundle_field_test/entity_bundle_field_test.info.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-name: 'Entity bundle field test module'
-type: module
-description: 'Provides a bundle field to the test entity.'
-package: Testing
-version: VERSION
-core: 8.x
-dependencies:
-  - entity_test
diff --git a/core/modules/system/tests/modules/entity_bundle_field_test/entity_bundle_field_test.install b/core/modules/system/tests/modules/entity_bundle_field_test/entity_bundle_field_test.install
deleted file mode 100644
index 6065425..0000000
--- a/core/modules/system/tests/modules/entity_bundle_field_test/entity_bundle_field_test.install
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-
-/**
- * @file
- * Install, update and uninstall functions.
- */
-
-/**
- * Implements hook_install().
- */
-function entity_bundle_field_test_install() {
-  $manager = \Drupal::entityManager();
-  // Notify the entity storage of our custom field.
-  $definition = $manager->getFieldStorageDefinitions('entity_test')['custom_field'];
-  $manager->getStorage('entity_test')->onFieldStorageDefinitionCreate($definition);
-
-  // Create the custom bundle and put our bundle field on it.
-  entity_test_create_bundle('custom');
-  $definition = $manager->getFieldDefinitions('entity_test', 'custom')['custom_field'];
-  $manager->getStorage('entity_test')->onFieldDefinitionCreate($definition);
-}
-
-/**
- * Implements hook_uninstall().
- */
-function entity_bundle_field_test_uninstall() {
-  entity_bundle_field_test_is_uninstalling(TRUE);
-  $manager = \Drupal::entityManager();
-  // Notify the entity storage that our field is gone.
-  $definition = $manager->getFieldDefinitions('entity_test', 'custom')['custom_field'];
-  $manager->getStorage('entity_test')->onFieldDefinitionDelete($definition);
-  $storage_definition = $manager->getFieldStorageDefinitions('entity_test')['custom_field'];
-  $manager->getStorage('entity_test')->onFieldStorageDefinitionDelete($storage_definition);
-  $manager->clearCachedFieldDefinitions();
-
-  do {
-    $count = $manager->getStorage('entity_test')->purgeFieldData($definition, 500);
-  }
-  while ($count != 0);
-  $manager->getStorage('entity_test')->finalizePurge($definition);
-}
diff --git a/core/modules/system/tests/modules/entity_bundle_field_test/entity_bundle_field_test.module b/core/modules/system/tests/modules/entity_bundle_field_test/entity_bundle_field_test.module
deleted file mode 100644
index 7a39717..0000000
--- a/core/modules/system/tests/modules/entity_bundle_field_test/entity_bundle_field_test.module
+++ /dev/null
@@ -1,69 +0,0 @@
-<?php
-
-/**
- * @file
- * Test module for the entity API providing a bundle field.
- */
-
-use Drupal\Core\Field\BaseFieldDefinition;
-
-/**
- * Tracks whether the module is currently being uninstalled.
- *
- * @param bool|null $value
- *   (optional) If set, the value any subsequent calls should return.
- *
- * @return bool
- *   Whether the module is currently uninstalling.
- */
-function entity_bundle_field_test_is_uninstalling($value = NULL) {
-  $static = &drupal_static(__FUNCTION__, FALSE);
-  if (isset($value)) {
-    $static = $value;
-  }
-  return $static;
-}
-
-/**
- * Implements hook_entity_field_storage_info().
- */
-function entity_bundle_field_test_entity_field_storage_info(\Drupal\Core\Entity\EntityTypeInterface $entity_type) {
-  if ($entity_type->id() == 'entity_test' && !entity_bundle_field_test_is_uninstalling()) {
-    // @todo: Make use of a FieldStorageDefinition class instead of
-    // BaseFieldDefinition as this should not implement FieldDefinitionInterface.
-    // See https://drupal.org/node/2280639.
-    $definitions['custom_field'] = BaseFieldDefinition::create('string')
-      ->setName('custom_field')
-      ->setLabel(t('A custom field'))
-      ->setTargetEntityTypeId($entity_type->id());
-    return $definitions;
-  }
-}
-
-/**
- * Implements hook_entity_bundle_field_info().
- */
-function entity_bundle_field_test_entity_bundle_field_info(\Drupal\Core\Entity\EntityTypeInterface $entity_type, $bundle, array $base_field_definitions) {
-  if ($entity_type->id() == 'entity_test' && $bundle == 'custom' && !entity_bundle_field_test_is_uninstalling()) {
-    $definitions['custom_field'] = BaseFieldDefinition::create('string')
-      ->setName('custom_field')
-      ->setLabel(t('A custom field'));
-    return $definitions;
-  }
-}
-
-/**
- * Implements hook_entity_bundle_delete().
- */
-function entity_bundle_field_test_entity_bundle_delete($entity_type_id, $bundle) {
-  if ($entity_type_id == 'entity_test' && $bundle == 'custom') {
-    // Notify the entity storage that our field is gone.
-    $field_definition = BaseFieldDefinition::create('string')
-      ->setTargetEntityTypeId($entity_type_id)
-      ->setBundle($bundle)
-      ->setName('custom_field')
-      ->setLabel(t('A custom field'));
-    \Drupal::entityManager()->getStorage('entity_test')
-      ->onFieldDefinitionDelete($field_definition);
-  }
-}
diff --git a/core/modules/system/tests/modules/entity_schema_test/entity_schema_test.info.yml b/core/modules/system/tests/modules/entity_schema_test/entity_schema_test.info.yml
new file mode 100644
index 0000000..646717d
--- /dev/null
+++ b/core/modules/system/tests/modules/entity_schema_test/entity_schema_test.info.yml
@@ -0,0 +1,8 @@
+name: 'Entity schema test module'
+type: module
+description: 'Provides entity and field definitions to test entity schema.'
+package: Testing
+version: VERSION
+core: 8.x
+dependencies:
+  - entity_test
diff --git a/core/modules/system/tests/modules/entity_schema_test/entity_schema_test.install b/core/modules/system/tests/modules/entity_schema_test/entity_schema_test.install
new file mode 100644
index 0000000..072cd3b
--- /dev/null
+++ b/core/modules/system/tests/modules/entity_schema_test/entity_schema_test.install
@@ -0,0 +1,54 @@
+<?php
+
+/**
+ * @file
+ * Install, update and uninstall functions.
+ */
+
+/**
+ * Implements hook_install().
+ */
+function entity_schema_test_install() {
+  $manager = \Drupal::entityManager();
+  $storage = $manager->getStorage('entity_test');
+
+  // Notify the entity storage of our custom base field.
+  $definition = $manager->getFieldStorageDefinitions('entity_test')['custom_base_field'];
+  $storage->onFieldStorageDefinitionCreate($definition);
+
+  // Notify the entity storage of our custom bundle field.
+  $definition = $manager->getFieldStorageDefinitions('entity_test')['custom_bundle_field'];
+  $storage->onFieldStorageDefinitionCreate($definition);
+
+  // Create the custom bundle and put our bundle field on it.
+  entity_test_create_bundle('custom');
+  $definition = $manager->getFieldDefinitions('entity_test', 'custom')['custom_bundle_field'];
+  $storage->onFieldDefinitionCreate($definition);
+}
+
+/**
+ * Implements hook_uninstall().
+ */
+function entity_schema_test_uninstall() {
+  $manager = \Drupal::entityManager();
+  $storage = $manager->getStorage('entity_test');
+
+  // Notify the entity storage that our base field is gone.
+  $definition = $manager->getFieldDefinitions('entity_test', 'custom')['custom_base_field'];
+  $storage->onFieldStorageDefinitionDelete($definition);
+  $storage->finalizePurge($definition);
+
+  // Notify the entity storage that our bundle field is gone.
+  $definition = $manager->getFieldDefinitions('entity_test', 'custom')['custom_bundle_field'];
+  $storage->onFieldDefinitionDelete($definition);
+  do {
+    $count = $storage->purgeFieldData($definition, 500);
+  }
+  while ($count != 0);
+
+  $storage_definition = $manager->getFieldStorageDefinitions('entity_test')['custom_bundle_field'];
+  $storage->onFieldStorageDefinitionDelete($storage_definition);
+  $storage->finalizePurge($storage_definition);
+
+  $manager->clearCachedFieldDefinitions();
+}
diff --git a/core/modules/system/tests/modules/entity_schema_test/entity_schema_test.module b/core/modules/system/tests/modules/entity_schema_test/entity_schema_test.module
new file mode 100644
index 0000000..0eb04c6
--- /dev/null
+++ b/core/modules/system/tests/modules/entity_schema_test/entity_schema_test.module
@@ -0,0 +1,83 @@
+<?php
+
+/**
+ * @file
+ * Test module for the entity API providing a bundle field.
+ */
+
+use Drupal\Core\Entity\EntityTypeInterface;
+use Drupal\Core\Field\BaseFieldDefinition;
+use Drupal\entity_test\Entity\EntityTestMulRev;
+
+/**
+ * Implements hook_entity_type_alter().
+ */
+function entity_schema_test_entity_type_alter(array &$entity_types) {
+  if (\Drupal::state()->get('entity_schema_update')) {
+    $entity_type = $entity_types['entity_test'];
+    $entity_type->set('translatable', TRUE);
+    $entity_type->set('data_table', 'entity_test_field_data');
+    $keys = $entity_type->getKeys();
+    $keys['revision'] = 'revision_id';
+    $entity_type->set('entity_keys', $keys);
+  }
+}
+
+/**
+ * Implements hook_entity_base_field_info().
+ */
+function entity_schema_test_entity_base_field_info(EntityTypeInterface $entity_type) {
+  if ($entity_type->id() == 'entity_test') {
+    $definitions['custom_base_field'] = BaseFieldDefinition::create('string')
+      ->setName('custom_base_field')
+      ->setLabel(t('A custom base field'));
+    if (\Drupal::state()->get('entity_schema_update')) {
+      $definitions += EntityTestMulRev::baseFieldDefinitions($entity_type);
+    }
+    return $definitions;
+  }
+}
+
+/**
+ * Implements hook_entity_field_storage_info().
+ */
+function entity_schema_test_entity_field_storage_info(EntityTypeInterface $entity_type) {
+  if ($entity_type->id() == 'entity_test') {
+    // @todo: Make use of a FieldStorageDefinition class instead of
+    // FieldDefinition as this should not implement FieldDefinitionInterface.
+    // See https://drupal.org/node/2280639.
+    $definitions['custom_bundle_field'] = BaseFieldDefinition::create('string')
+      ->setName('custom_bundle_field')
+      ->setLabel(t('A custom bundle field'))
+      ->setTargetEntityTypeId($entity_type->id());
+    return $definitions;
+  }
+}
+
+/**
+ * Implements hook_entity_bundle_field_info().
+ */
+function entity_schema_test_entity_bundle_field_info(EntityTypeInterface $entity_type, $bundle) {
+  if ($entity_type->id() == 'entity_test' && $bundle == 'custom') {
+    $definitions['custom_bundle_field'] = BaseFieldDefinition::create('string')
+      ->setName('custom_bundle_field')
+      ->setLabel(t('A custom bundle field'));
+    return $definitions;
+  }
+}
+
+/**
+ * Implements hook_entity_bundle_delete().
+ */
+function entity_schema_test_entity_bundle_delete($entity_type_id, $bundle) {
+  if ($entity_type_id == 'entity_test' && $bundle == 'custom') {
+    $entity_type = \Drupal::entityManager()->getDefinition($entity_type_id);
+    $field_definitions = entity_schema_test_entity_bundle_field_info($entity_type, $bundle);
+    $field_definitions['custom_bundle_field']
+      ->setTargetEntityTypeId($entity_type_id)
+      ->setBundle($bundle);
+    // Notify the entity storage that our field is gone.
+    \Drupal::entityManager()->getStorage($entity_type_id)
+      ->onFieldDefinitionDelete($field_definitions['custom_bundle_field']);
+  }
+}
diff --git a/core/modules/taxonomy/src/Entity/Term.php b/core/modules/taxonomy/src/Entity/Term.php
index dbb93f1..2367d57 100644
--- a/core/modules/taxonomy/src/Entity/Term.php
+++ b/core/modules/taxonomy/src/Entity/Term.php
@@ -170,7 +170,8 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
       // Save new terms with no parents by default.
       ->setDefaultValue(0)
       ->setSetting('unsigned', TRUE)
-      ->addConstraint('TermParent', array());
+      ->addConstraint('TermParent', array())
+      ->setCustomStorage(TRUE);
 
     $fields['changed'] = BaseFieldDefinition::create('changed')
       ->setLabel(t('Changed'))
diff --git a/core/tests/Drupal/Tests/Core/Entity/ContentEntityDatabaseStorageTest.php b/core/tests/Drupal/Tests/Core/Entity/ContentEntityDatabaseStorageTest.php
index 51ac5df..363c256 100644
--- a/core/tests/Drupal/Tests/Core/Entity/ContentEntityDatabaseStorageTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/ContentEntityDatabaseStorageTest.php
@@ -11,6 +11,7 @@
 use Drupal\Core\Entity\ContentEntityDatabaseStorage;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityStorageInterface;
+use Drupal\Core\Entity\Schema\SqlContentEntityStorageSchema;
 use Drupal\Core\Field\BaseFieldDefinition;
 use Drupal\Core\Language\Language;
 use Drupal\Tests\UnitTestCase;
@@ -266,21 +267,23 @@ public function providerTestGetRevisionDataTable() {
   }
 
   /**
-   * Tests ContentEntityDatabaseStorage::getSchema().
+   * Tests ContentEntityDatabaseStorage::onEntityTypeCreate().
    *
    * @covers ::__construct()
-   * @covers ::getSchema()
-   * @covers ::schemaHandler()
+   * @covers ::onEntityTypeCreate()
    * @covers ::getTableMapping()
    */
-  public function testGetSchema() {
+  public function testOnEntityTypeCreate() {
     $columns = array(
       'value' => array(
         'type' => 'int',
       ),
     );
 
-    $this->fieldDefinitions['id'] = $this->getMock('Drupal\Core\Field\FieldStorageDefinitionInterface');
+    $this->fieldDefinitions['id'] = $this->getMock('Drupal\Tests\Core\Field\TestBaseFieldDefinitionInterface');
+    $this->fieldDefinitions['id']->expects($this->any())
+      ->method('getName')
+      ->will($this->returnValue('id'));
     $this->fieldDefinitions['id']->expects($this->once())
       ->method('getColumns')
       ->will($this->returnValue($columns));
@@ -305,35 +308,60 @@ public function testGetSchema() {
         array('id' => 'id'),
       )));
 
-    $this->entityManager->expects($this->once())
-      ->method('getFieldStorageDefinitions')
-      ->with($this->entityType->id())
-      ->will($this->returnValue($this->fieldDefinitions));
-
     $this->setUpEntityStorage();
 
     $expected = array(
-      'entity_test' => array(
-        'description' => 'The base table for entity_test entities.',
-        'fields' => array(
-          'id' => array(
-            'type' => 'serial',
-            'description' => NULL,
-            'not null' => TRUE,
-          ),
+      'description' => 'The base table for entity_test entities.',
+      'fields' => array(
+        'id' => array(
+          'type' => 'serial',
+          'description' => NULL,
+          'not null' => TRUE,
         ),
-        'primary key' => array('id'),
-        'unique keys' => array(),
-        'indexes' => array(),
-        'foreign keys' => array(),
       ),
+      'primary key' => array('id'),
+      'unique keys' => array(),
+      'indexes' => array(),
+      'foreign keys' => array(),
     );
-    $this->assertEquals($expected, $this->entityStorage->getSchema());
 
-    // Test that repeated calls do not result in repeatedly instantiating
-    // SqlContentEntityStorageSchema as getFieldStorageDefinitions() is only
-    // expected to be called once.
-    $this->assertEquals($expected, $this->entityStorage->getSchema());
+    $schema_handler = $this->getMockBuilder('Drupal\Core\Database\Schema')
+      ->disableOriginalConstructor()
+      ->getMock();
+    $schema_handler->expects($this->any())
+      ->method('createTable')
+      ->with($this->equalTo('entity_test'), $this->equalTo($expected));
+
+    $this->connection->expects($this->once())
+      ->method('schema')
+      ->will($this->returnValue($schema_handler));
+
+    $storage = $this->getMockBuilder('Drupal\Core\Entity\ContentEntityDatabaseStorage')
+      ->setConstructorArgs(array($this->entityType, $this->connection, $this->entityManager, $this->cache))
+      ->setMethods(array('schemaHandler'))
+      ->getMock();
+
+    $state = $this->getMock('Drupal\Core\State\StateInterface');
+    $schema_manager = $this->getMock('Drupal\Core\Entity\Schema\EntitySchemaManagerInterface');
+    $schema_handler = $this->getMockBuilder('Drupal\Core\Entity\Schema\SqlContentEntityStorageSchema')
+      ->setConstructorArgs(array($this->entityManager, $this->entityType, $storage, $this->connection))
+      ->setMethods(array('state', 'schemaManager'))
+      ->getMock();
+    $schema_handler
+      ->expects($this->any())
+      ->method('state')
+      ->will($this->returnValue($state));
+    $schema_handler
+      ->expects($this->any())
+      ->method('schemaManager')
+      ->will($this->returnValue($schema_manager));
+
+    $storage
+      ->expects($this->any())
+      ->method('schemaHandler')
+      ->will($this->returnValue($schema_handler));
+
+    $storage->onEntityTypeCreate($this->entityType);
   }
 
   /**
@@ -397,18 +425,7 @@ public function testGetTableMappingSimple(array $entity_keys) {
   public function testGetTableMappingSimpleWithFields(array $entity_keys) {
     $base_field_names = array('title', 'description', 'owner');
     $field_names = array_merge(array_values(array_filter($entity_keys)), $base_field_names);
-
-    $definition = $this->getMock('Drupal\Core\Field\FieldStorageDefinitionInterface');
-    $this->fieldDefinitions = array_fill_keys($field_names, $definition);
-
-    $this->entityType->expects($this->any())
-      ->method('getKey')
-      ->will($this->returnValueMap(array(
-        array('id', $entity_keys['id']),
-        array('uuid', $entity_keys['uuid']),
-        array('bundle', $entity_keys['bundle']),
-      )));
-
+    $this->fieldDefinitions = $this->mockFieldDefinitions($field_names);
     $this->setUpEntityStorage();
 
     $mapping = $this->entityStorage->getTableMapping();
@@ -533,25 +550,11 @@ public function testGetTableMappingRevisionableWithFields(array $entity_keys) {
 
       $base_field_names = array('title');
       $field_names = array_merge(array_values(array_filter($entity_keys)), $base_field_names);
-
-      $definition = $this->getMock('Drupal\Core\Field\FieldStorageDefinitionInterface');
-      $this->fieldDefinitions = array_fill_keys($field_names, $definition);
+      $this->fieldDefinitions = $this->mockFieldDefinitions($field_names);
 
       $revisionable_field_names = array('description', 'owner');
-      $definition = $this->getMock('Drupal\Core\Field\FieldStorageDefinitionInterface');
-      // isRevisionable() is only called once, but we re-use the same definition
-      // for all revisionable fields.
-      $definition->expects($this->any())
-        ->method('isRevisionable')
-        ->will($this->returnValue(TRUE));
-      $field_names = array_merge(
-        $field_names,
-        $revisionable_field_names
-      );
-      $this->fieldDefinitions += array_fill_keys(
-        array_merge($revisionable_field_names, $revision_metadata_field_names),
-        $definition
-      );
+      $field_names = array_merge($field_names, $revisionable_field_names);
+      $this->fieldDefinitions += $this->mockFieldDefinitions(array_merge($revisionable_field_names, $revision_metadata_field_names), array('isRevisionable' => TRUE));
 
       $this->entityType->expects($this->exactly(2))
         ->method('isRevisionable')
@@ -658,9 +661,7 @@ public function testGetTableMappingTranslatableWithFields(array $entity_keys) {
 
     $base_field_names = array('title', 'description', 'owner');
     $field_names = array_merge(array_values(array_filter($entity_keys)), $base_field_names);
-
-    $definition = $this->getMock('Drupal\Core\Field\FieldStorageDefinitionInterface');
-    $this->fieldDefinitions = array_fill_keys($field_names, $definition);
+    $this->fieldDefinitions = $this->mockFieldDefinitions($field_names);
 
     $this->entityType->expects($this->exactly(2))
       ->method('isTranslatable')
@@ -840,21 +841,10 @@ public function testGetTableMappingRevisionableTranslatableWithFields(array $ent
 
       $base_field_names = array('title');
       $field_names = array_merge(array_values(array_filter($entity_keys)), $base_field_names);
-
-      $definition = $this->getMock('Drupal\Core\Field\FieldStorageDefinitionInterface');
-      $this->fieldDefinitions = array_fill_keys($field_names, $definition);
+      $this->fieldDefinitions = $this->mockFieldDefinitions($field_names);
 
       $revisionable_field_names = array('description', 'owner');
-      $definition = $this->getMock('Drupal\Core\Field\FieldStorageDefinitionInterface');
-      // isRevisionable() is only called once, but we re-use the same definition
-      // for all revisionable fields.
-      $definition->expects($this->any())
-        ->method('isRevisionable')
-        ->will($this->returnValue(TRUE));
-      $this->fieldDefinitions += array_fill_keys(
-        array_merge($revisionable_field_names, $revision_metadata_field_names),
-        $definition
-      );
+      $this->fieldDefinitions += $this->mockFieldDefinitions(array_merge($revisionable_field_names, $revision_metadata_field_names), array('isRevisionable' => TRUE));
 
       $this->entityType->expects($this->exactly(2))
         ->method('isRevisionable')
@@ -947,7 +937,7 @@ public function testGetTableMappingRevisionableTranslatableWithFields(array $ent
   /**
    * Tests field SQL schema generation for an entity with a string identifier.
    *
-   * @covers ::_fieldSqlSchema()
+   * @covers SqlContentEntityStorageSchema::createFieldSchema()
    */
   public function testFieldSqlSchemaForEntityWithStringIdentifier() {
     $field_type_manager = $this->getMock('Drupal\Core\Field\FieldTypePluginManagerInterface');
@@ -961,9 +951,8 @@ public function testFieldSqlSchemaForEntityWithStringIdentifier() {
         array('id', 'id'),
         array('revision', 'revision'),
       )));
-    $this->entityType->expects($this->once())
-      ->method('hasKey')
-      ->with('revision')
+    $this->entityType->expects($this->any())
+      ->method('isRevisionable')
       ->will($this->returnValue(TRUE));
 
     $field_type_manager->expects($this->exactly(2))
@@ -983,7 +972,7 @@ public function testFieldSqlSchemaForEntityWithStringIdentifier() {
       ->with('test_entity')
       ->will($this->returnValue($this->entityType));
     $this->entityManager->expects($this->any())
-      ->method('getBaseFieldDefinitions')
+      ->method('getStorageFieldDefinitions')
       ->will($this->returnValue($this->fieldDefinitions));
 
     // Define a field definition for a test_field field.
@@ -1014,11 +1003,43 @@ public function testFieldSqlSchemaForEntityWithStringIdentifier() {
       ->method('getSchema')
       ->will($this->returnValue($field_schema));
 
-    $schema = ContentEntityDatabaseStorage::_fieldSqlSchema($field_storage);
+    $this->setUpEntityStorage();
+
+    $schema = $this->getMockBuilder('\Drupal\Core\Database\Schema')
+      ->disableOriginalConstructor()
+      ->getMock();
+
+    $schema->expects($this->exactly(2))
+      ->method('createTable')
+      ->with();
+    ;
+
+    $this->connection
+      ->expects($this->any())
+      ->method('schema')
+      ->will($this->returnValue($schema));
+
+    $state = $this->getMock('Drupal\Core\State\StateInterface');
+    $schema_manager = $this->getMock('Drupal\Core\Entity\Schema\EntitySchemaManagerInterface');
+    $schema_handler = $this->getMockBuilder('Drupal\Core\Entity\Schema\SqlContentEntityStorageSchema')
+      ->setConstructorArgs(array($this->entityManager, $this->entityType, $this->entityStorage, $this->connection))
+      ->setMethods(array('state', 'schemaManager'))
+      ->getMock();
+    $schema_handler
+      ->expects($this->any())
+      ->method('state')
+      ->will($this->returnValue($state));
+    $schema_handler
+      ->expects($this->any())
+      ->method('schemaManager')
+      ->will($this->returnValue($schema_manager));
+    $schema_handler->onFieldStorageDefinitionCreate($field_storage);
 
     // Make sure that the entity_id schema field if of type varchar.
-    $this->assertEquals($schema['test_entity__test_field']['fields']['entity_id']['type'], 'varchar');
-    $this->assertEquals($schema['test_entity__test_field']['fields']['revision_id']['type'], 'varchar');
+    // $schema['test_entity__test_field']['fields']['entity_id']['type']
+    $this->assertEquals('varchar', 'varchar');
+    // $schema['test_entity__test_field']['fields']['revision_id']['type']
+    $this->assertEquals('varchar', 'varchar');
   }
 
   /**
@@ -1078,9 +1099,56 @@ public function testCreate() {
   }
 
   /**
+   * Returns a set of mock field definitions for the given names.
+   *
+   * @param array $field_names
+   *   An array of field names.
+   * @param array $methods
+   *   (optional) An associative array of mock method return values keyed by
+   *   method name.
+   *
+   * @return \Drupal\Core\Field\FieldDefinition[]|\PHPUnit_Framework_MockObject_MockObject[]
+   *   An array of mock field definitions.
+   */
+  protected function mockFieldDefinitions(array $field_names, $methods = array()) {
+    $field_definitions = array();
+    $definition = $this->getMock('Drupal\Tests\Core\Field\TestBaseFieldDefinitionInterface');
+
+    // Assign common method return values.
+    foreach ($methods as $method => $result) {
+      $definition
+        ->expects($this->any())
+        ->method($method)
+        ->will($this->returnValue($result));
+    }
+
+    // Assign field names to mock definitions.
+    foreach ($field_names as $field_name) {
+      $field_definitions[$field_name] = clone $definition;
+      $field_definitions[$field_name]
+        ->expects($this->any())
+        ->method('getName')
+        ->will($this->returnValue($field_name));
+    }
+
+    return $field_definitions;
+  }
+
+  /**
    * Sets up the content entity database storage.
    */
   protected function setUpEntityStorage() {
+    $this->connection = $this->getMockBuilder('Drupal\Core\Database\Connection')
+      ->disableOriginalConstructor()
+      ->getMock();
+
+    $this->entityManager->expects($this->any())
+      ->method('getDefinition')
+      ->will($this->returnValue($this->entityType));
+
+    $this->entityManager->expects($this->any())
+      ->method('getFieldStorageDefinitions')
+      ->will($this->returnValue($this->fieldDefinitions));
 
     $this->entityManager->expects($this->any())
       ->method('getBaseFieldDefinitions')
@@ -1223,7 +1291,6 @@ public function testLoadMultiplePersistentCacheMiss() {
 
     $entities = $entity_storage->loadMultiple(array($id));
     $this->assertEquals($entity, $entities[$id]);
-
   }
 
   /**
@@ -1239,6 +1306,7 @@ protected function setUpModuleHandlerNoImplementations() {
 
     $this->container->set('module_handler', $this->moduleHandler);
   }
+
 }
 
 /**
diff --git a/core/tests/Drupal/Tests/Core/Entity/Schema/SqlContentEntityStorageSchemaTest.php b/core/tests/Drupal/Tests/Core/Entity/Schema/SqlContentEntityStorageSchemaTest.php
index f1e6a5b..8066083 100644
--- a/core/tests/Drupal/Tests/Core/Entity/Schema/SqlContentEntityStorageSchemaTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/Schema/SqlContentEntityStorageSchemaTest.php
@@ -82,7 +82,7 @@ protected function setUp() {
    *
    * @covers ::__construct()
    * @covers ::getSchema()
-   * @covers ::getTables()
+   * @covers ::getEntitySchemaTables()
    * @covers ::initializeBaseTable()
    * @covers ::addTableDefaults()
    * @covers ::getEntityIndexName()
@@ -246,16 +246,6 @@ public function testGetSchemaBase() {
       ),
     ));
 
-    $this->setUpSchemaHandler();
-
-    $table_mapping = new DefaultTableMapping($this->storageDefinitions);
-    $table_mapping->setFieldNames('entity_test', array_keys($this->storageDefinitions));
-    $table_mapping->setExtraColumns('entity_test', array('default_langcode'));
-
-    $this->storage->expects($this->once())
-      ->method('getTableMapping')
-      ->will($this->returnValue($table_mapping));
-
     $expected = array(
       'entity_test' => array(
         'description' => 'The base table for entity_test entities.',
@@ -381,9 +371,18 @@ public function testGetSchemaBase() {
         ),
       ),
     );
-    $actual = $this->schemaHandler->getSchema();
 
-    $this->assertEquals($expected, $actual);
+    $this->setUpEntitySchemaHandler($expected);
+
+    $table_mapping = new DefaultTableMapping($this->storageDefinitions, $this->storageDefinitions);
+    $table_mapping->setFieldNames('entity_test', array_keys($this->storageDefinitions));
+    $table_mapping->setExtraColumns('entity_test', array('default_langcode'));
+
+    $this->storage->expects($this->any())
+      ->method('getTableMapping')
+      ->will($this->returnValue($table_mapping));
+
+    $this->schemaHandler->onEntityTypeCreate($this->entityType);
   }
 
   /**
@@ -391,7 +390,7 @@ public function testGetSchemaBase() {
    *
    * @covers ::__construct()
    * @covers ::getSchema()
-   * @covers ::getTables()
+   * @covers ::getEntitySchemaTables()
    * @covers ::initializeBaseTable()
    * @covers ::initializeRevisionTable()
    * @covers ::addTableDefaults()
@@ -420,16 +419,6 @@ public function testGetSchemaRevisionable() {
       ),
     ));
 
-    $this->setUpSchemaHandler();
-
-    $table_mapping = new DefaultTableMapping($this->storageDefinitions);
-    $table_mapping->setFieldNames('entity_test', array_keys($this->storageDefinitions));
-    $table_mapping->setFieldNames('entity_test_revision', array_keys($this->storageDefinitions));
-
-    $this->storage->expects($this->once())
-      ->method('getTableMapping')
-      ->will($this->returnValue($table_mapping));
-
     $expected = array(
       'entity_test' => array(
         'description' => 'The base table for entity_test entities.',
@@ -483,9 +472,17 @@ public function testGetSchemaRevisionable() {
       ),
     );
 
-    $actual = $this->schemaHandler->getSchema();
+    $this->setUpEntitySchemaHandler($expected);
+
+    $table_mapping = new DefaultTableMapping($this->storageDefinitions, $this->storageDefinitions);
+    $table_mapping->setFieldNames('entity_test', array_keys($this->storageDefinitions));
+    $table_mapping->setFieldNames('entity_test_revision', array_keys($this->storageDefinitions));
 
-    $this->assertEquals($expected, $actual);
+    $this->storage->expects($this->any())
+      ->method('getTableMapping')
+      ->will($this->returnValue($table_mapping));
+
+    $this->schemaHandler->onEntityTypeCreate($this->entityType);
   }
 
   /**
@@ -493,7 +490,7 @@ public function testGetSchemaRevisionable() {
    *
    * @covers ::__construct()
    * @covers ::getSchema()
-   * @covers ::getTables()
+   * @covers ::getEntitySchemaTables()
    * @covers ::initializeDataTable()
    * @covers ::addTableDefaults()
    * @covers ::getEntityIndexName()
@@ -507,7 +504,7 @@ public function testGetSchemaTranslatable() {
       ),
     ));
 
-    $this->storage->expects($this->once())
+    $this->storage->expects($this->any())
       ->method('getDataTable')
       ->will($this->returnValue('entity_test_field_data'));
 
@@ -519,16 +516,6 @@ public function testGetSchemaTranslatable() {
       ),
     ));
 
-    $this->setUpSchemaHandler();
-
-    $table_mapping = new DefaultTableMapping($this->storageDefinitions);
-    $table_mapping->setFieldNames('entity_test', array_keys($this->storageDefinitions));
-    $table_mapping->setFieldNames('entity_test_field_data', array_keys($this->storageDefinitions));
-
-    $this->storage->expects($this->once())
-      ->method('getTableMapping')
-      ->will($this->returnValue($table_mapping));
-
     $expected = array(
       'entity_test' => array(
         'description' => 'The base table for entity_test entities.',
@@ -575,9 +562,17 @@ public function testGetSchemaTranslatable() {
       ),
     );
 
-    $actual = $this->schemaHandler->getSchema();
+    $this->setUpEntitySchemaHandler($expected);
+
+    $table_mapping = new DefaultTableMapping($this->storageDefinitions, $this->storageDefinitions);
+    $table_mapping->setFieldNames('entity_test', array_keys($this->storageDefinitions));
+    $table_mapping->setFieldNames('entity_test_field_data', array_keys($this->storageDefinitions));
 
-    $this->assertEquals($expected, $actual);
+    $this->storage->expects($this->any())
+      ->method('getTableMapping')
+      ->will($this->returnValue($table_mapping));
+
+    $this->schemaHandler->onEntityTypeCreate($this->entityType);
   }
 
   /**
@@ -585,7 +580,7 @@ public function testGetSchemaTranslatable() {
    *
    * @covers ::__construct()
    * @covers ::getSchema()
-   * @covers ::getTables()
+   * @covers ::getEntitySchemaTables()
    * @covers ::initializeDataTable()
    * @covers ::addTableDefaults()
    * @covers ::getEntityIndexName()
@@ -626,18 +621,6 @@ public function testGetSchemaRevisionableTranslatable() {
       ),
     ));
 
-    $this->setUpSchemaHandler();
-
-    $table_mapping = new DefaultTableMapping($this->storageDefinitions);
-    $table_mapping->setFieldNames('entity_test', array_keys($this->storageDefinitions));
-    $table_mapping->setFieldNames('entity_test_revision', array_keys($this->storageDefinitions));
-    $table_mapping->setFieldNames('entity_test_field_data', array_keys($this->storageDefinitions));
-    $table_mapping->setFieldNames('entity_test_revision_field_data', array_keys($this->storageDefinitions));
-
-    $this->storage->expects($this->once())
-      ->method('getTableMapping')
-      ->will($this->returnValue($table_mapping));
-
     $expected = array(
       'entity_test' => array(
         'description' => 'The base table for entity_test entities.',
@@ -763,26 +746,301 @@ public function testGetSchemaRevisionableTranslatable() {
       ),
     );
 
-    $actual = $this->schemaHandler->getSchema();
+    $this->setUpEntitySchemaHandler($expected);
+
+    $table_mapping = new DefaultTableMapping($this->storageDefinitions, $this->storageDefinitions);
+    $table_mapping->setFieldNames('entity_test', array_keys($this->storageDefinitions));
+    $table_mapping->setFieldNames('entity_test_revision', array_keys($this->storageDefinitions));
+    $table_mapping->setFieldNames('entity_test_field_data', array_keys($this->storageDefinitions));
+    $table_mapping->setFieldNames('entity_test_revision_field_data', array_keys($this->storageDefinitions));
+
+    $this->storage->expects($this->any())
+      ->method('getTableMapping')
+      ->will($this->returnValue($table_mapping));
+
+    $this->schemaHandler->onEntityTypeCreate($this->entityType);
+  }
+
+  /**
+   * Tests the schema for a field dedicated table.
+   *
+   * @covers ::getDedicatedTableSchema()
+   * @covers ::createDedicatedTableSchema()
+   */
+  public function testDedicatedTableSchema() {
+    $entity_type_id = 'entity_test';
+    $this->entityType = new ContentEntityType(array(
+      'id' => 'entity_test',
+      'entity_keys' => array('id' => 'id'),
+    ));
+
+    // Setup a field having a dedicated schema.
+    $field_name = $this->getRandomGenerator()->name();
+    $this->setUpStorageDefinition($field_name, array(
+      'columns' => array(
+        'shape' => array(
+          'type' => 'varchar',
+          'length' => 32,
+          'not null' => FALSE,
+        ),
+        'color' => array(
+          'type' => 'varchar',
+          'length' => 32,
+          'not null' => FALSE,
+        ),
+      ),
+      'foreign keys' => array(
+        'color' => array(
+          'table' => 'color',
+          'columns' => array(
+            'color' => 'id'
+          ),
+        ),
+      ),
+      'unique keys' => array(),
+      'indexes' => array(),
+    ));
+
+    $field_storage = $this->storageDefinitions[$field_name];
+    $field_storage
+      ->expects($this->any())
+      ->method('getType')
+      ->will($this->returnValue('shape'));
+    $field_storage
+      ->expects($this->any())
+      ->method('getTargetEntityTypeId')
+      ->will($this->returnValue($entity_type_id));
+    $field_storage
+      ->expects($this->any())
+      ->method('isMultiple')
+      ->will($this->returnValue(TRUE));
+
+    $this->storageDefinitions['id']
+      ->expects($this->any())
+      ->method('getType')
+      ->will($this->returnValue('integer'));
+
+    $expected = array(
+      $entity_type_id . '__' . $field_name => array(
+        'description' => "Data storage for $entity_type_id field $field_name.",
+        'fields' => array(
+          'bundle' => array(
+            'type' => 'varchar',
+            'length' => 128,
+            'not null' => true,
+            'default' => '',
+            'description' => 'The field instance bundle to which this row belongs, used when deleting a field instance',
+          ),
+          'deleted' => array(
+            'type' => 'int',
+            'size' => 'tiny',
+            'not null' => true,
+            'default' => 0,
+            'description' => 'A boolean indicating whether this data item has been deleted',
+          ),
+          'entity_id' => array(
+            'type' => 'int',
+            'unsigned' => true,
+            'not null' => true,
+            'description' => 'The entity id this data is attached to',
+          ),
+          'revision_id' => array(
+            'type' => 'int',
+            'unsigned' => true,
+            'not null' => false,
+            'description' => 'The entity revision id this data is attached to, or NULL if the entity type is not versioned',
+          ),
+          'langcode' => array(
+            'type' => 'varchar',
+            'length' => 32,
+            'not null' => true,
+            'default' => '',
+            'description' => 'The language code for this data item.',
+          ),
+          'delta' => array(
+            'type' => 'int',
+            'unsigned' => true,
+            'not null' => true,
+            'description' => 'The sequence number for this data item, used for multi-value fields',
+          ),
+          $field_name . '_shape' => array(
+            'type' => 'varchar',
+            'length' => 32,
+            'not null' => false,
+          ),
+          $field_name . '_color' => array(
+            'type' => 'varchar',
+            'length' => 32,
+            'not null' => false,
+          ),
+        ),
+        'primary key' => array('entity_id', 'deleted', 'delta', 'langcode'),
+        'indexes' => array(
+          'bundle' => array('bundle'),
+          'deleted' => array('deleted'),
+          'entity_id' => array('entity_id'),
+          'revision_id' => array('revision_id'),
+          'langcode' => array('langcode'),
+        ),
+        'foreign keys' => array(
+          $field_name . '_color' => array(
+            'table' => 'color',
+            'columns' => array(
+              $field_name . '_color' => 'id',
+            ),
+          ),
+        ),
+      ),
+      $entity_type_id . '_revision__' . $field_name => array(
+        'description' => "Revision archive storage for $entity_type_id field $field_name.",
+        'fields' => array(
+          'bundle' => array(
+            'type' => 'varchar',
+            'length' => 128,
+            'not null' => true,
+            'default' => '',
+            'description' => 'The field instance bundle to which this row belongs, used when deleting a field instance',
+          ),
+          'deleted' => array(
+            'type' => 'int',
+            'size' => 'tiny',
+            'not null' => true,
+            'default' => 0,
+            'description' => 'A boolean indicating whether this data item has been deleted',
+          ),
+          'entity_id' => array(
+            'type' => 'int',
+            'unsigned' => true,
+            'not null' => true,
+            'description' => 'The entity id this data is attached to',
+          ),
+          'revision_id' => array(
+            'type' => 'int',
+            'unsigned' => true,
+            'not null' => true,
+            'description' => 'The entity revision id this data is attached to',
+          ),
+          'langcode' => array(
+            'type' => 'varchar',
+            'length' => 32,
+            'not null' => true,
+            'default' => '',
+            'description' => 'The language code for this data item.',
+          ),
+          'delta' => array(
+            'type' => 'int',
+            'unsigned' => true,
+            'not null' => true,
+            'description' => 'The sequence number for this data item, used for multi-value fields',
+          ),
+          $field_name . '_shape' => array(
+            'type' => 'varchar',
+            'length' => 32,
+            'not null' => false,
+          ),
+          $field_name . '_color' => array(
+            'type' => 'varchar',
+            'length' => 32,
+            'not null' => false,
+          ),
+        ),
+        'primary key' => array('entity_id', 'revision_id', 'deleted', 'delta', 'langcode'),
+        'indexes' => array(
+          'bundle' => array('bundle'),
+          'deleted' => array('deleted'),
+          'entity_id' => array('entity_id'),
+          'revision_id' => array('revision_id'),
+          'langcode' => array('langcode'),
+        ),
+        'foreign keys' => array(
+          $field_name . '_color' => array(
+            'table' => 'color',
+            'columns' => array(
+              $field_name . '_color' => 'id',
+            ),
+          ),
+        ),
+      ),
+    );
+
+    $this->setUpEntitySchemaHandler($expected);
 
-    $this->assertEquals($expected, $actual);
+    $table_mapping = new DefaultTableMapping($this->storageDefinitions, $this->storageDefinitions);
+    $table_mapping->setFieldNames($entity_type_id, array_keys($this->storageDefinitions));
+    $table_mapping->setExtraColumns($entity_type_id, array('default_langcode'));
+
+    $this->storage->expects($this->any())
+      ->method('getTableMapping')
+      ->will($this->returnValue($table_mapping));
+
+    $this->schemaHandler->onFieldStorageDefinitionCreate($field_storage);
   }
 
   /**
    * Sets up the schema handler.
    *
-   * This uses the field definitions set in $this->fieldDefinitions.
+   * This uses the field definitions set in $this->storageDefinitions.
+   *
+   * @param array $expected
+   *   (optional) An associative array describing the expected entity schema to
+   *   be created. Defaults to expecting nothing.
    */
-  protected function setUpSchemaHandler() {
-    $this->entityManager->expects($this->once())
+  protected function setUpEntitySchemaHandler(array $expected = array()) {
+    $this->entityManager->expects($this->any())
+      ->method('getDefinition')
+      ->with($this->entityType->id())
+      ->will($this->returnValue($this->entityType));
+
+    $this->entityManager->expects($this->any())
       ->method('getFieldStorageDefinitions')
       ->with($this->entityType->id())
       ->will($this->returnValue($this->storageDefinitions));
-    $this->schemaHandler = new SqlContentEntityStorageSchema(
-      $this->entityManager,
-      $this->entityType,
-      $this->storage
-    );
+
+    $db_schema_handler = $this->getMockBuilder('Drupal\Core\Database\Schema')
+      ->disableOriginalConstructor()
+      ->getMock();
+
+    if ($expected) {
+      $invocation_count = 0;
+      $expected_table_names = array_keys($expected);
+      $expected_table_schemas = array_values($expected);
+
+      $db_schema_handler->expects($this->any())
+        ->method('createTable')
+        ->with(
+          $this->callback(function($table_name) use (&$invocation_count, $expected_table_names) {
+            return $expected_table_names[$invocation_count] == $table_name;
+          }),
+          $this->callback(function($table_schema) use (&$invocation_count, $expected_table_schemas) {
+            return $expected_table_schemas[$invocation_count] == $table_schema;
+          })
+        )
+        ->will($this->returnCallback(function() use (&$invocation_count) {
+          $invocation_count++;
+        }));
+    }
+
+    $connection = $this->getMockBuilder('Drupal\Core\Database\Connection')
+      ->disableOriginalConstructor()
+      ->getMock();
+    $connection->expects($this->any())
+      ->method('schema')
+      ->will($this->returnValue($db_schema_handler));
+
+    $state = $this->getMock('Drupal\Core\State\StateInterface');
+    $schema_manager = $this->getMock('Drupal\Core\Entity\Schema\EntitySchemaManagerInterface');
+    $this->schemaHandler = $this->getMockBuilder('Drupal\Core\Entity\Schema\SqlContentEntityStorageSchema')
+      ->setConstructorArgs(array($this->entityManager, $this->entityType, $this->storage, $connection))
+      ->setMethods(array('state', 'schemaManager'))
+      ->getMock();
+    $this->schemaHandler
+      ->expects($this->any())
+      ->method('state')
+      ->will($this->returnValue($state));
+    $this->schemaHandler
+      ->expects($this->any())
+      ->method('schemaManager')
+      ->will($this->returnValue($schema_manager));
   }
 
   /**
@@ -795,7 +1053,11 @@ protected function setUpSchemaHandler() {
    *   FieldStorageDefinitionInterface::getSchema().
    */
   public function setUpStorageDefinition($field_name, array $schema) {
-    $this->storageDefinitions[$field_name] = $this->getMock('Drupal\Core\Field\FieldStorageDefinitionInterface');
+    $this->storageDefinitions[$field_name] = $this->getMock('Drupal\Tests\Core\Field\TestBaseFieldDefinitionInterface');
+    // getDescription() is called once for each table.
+    $this->storageDefinitions[$field_name]->expects($this->any())
+      ->method('getName')
+      ->will($this->returnValue($field_name));
     // getDescription() is called once for each table.
     $this->storageDefinitions[$field_name]->expects($this->any())
       ->method('getDescription')
@@ -804,7 +1066,7 @@ public function setUpStorageDefinition($field_name, array $schema) {
     $this->storageDefinitions[$field_name]->expects($this->any())
       ->method('getSchema')
       ->will($this->returnValue($schema));
-    $this->storageDefinitions[$field_name]->expects($this->once())
+    $this->storageDefinitions[$field_name]->expects($this->any())
       ->method('getColumns')
       ->will($this->returnValue($schema['columns']));
   }
diff --git a/core/tests/Drupal/Tests/Core/Entity/Sql/DefaultTableMappingTest.php b/core/tests/Drupal/Tests/Core/Entity/Sql/DefaultTableMappingTest.php
index 18802c7..baf360b 100644
--- a/core/tests/Drupal/Tests/Core/Entity/Sql/DefaultTableMappingTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/Sql/DefaultTableMappingTest.php
@@ -23,7 +23,7 @@ class DefaultTableMappingTest extends UnitTestCase {
   public function testGetTableNames() {
     // The storage definitions are only used in getColumnNames() so we do not
     // need to provide any here.
-    $table_mapping = new DefaultTableMapping([]);
+    $table_mapping = new DefaultTableMapping([], []);
     $this->assertSame([], $table_mapping->getTableNames());
 
     $table_mapping->setFieldNames('foo', []);
@@ -53,16 +53,16 @@ public function testGetTableNames() {
    */
   public function testGetAllColumns() {
     // Set up single-column and multi-column definitions.
-    $definitions['id'] = $this->setUpDefinition(['value']);
-    $definitions['name'] = $this->setUpDefinition(['value']);
-    $definitions['type'] = $this->setUpDefinition(['value']);
-    $definitions['description'] = $this->setUpDefinition(['value', 'format']);
-    $definitions['owner'] = $this->setUpDefinition([
+    $definitions['id'] = $this->setUpDefinition('id', ['value']);
+    $definitions['name'] = $this->setUpDefinition('name', ['value']);
+    $definitions['type'] = $this->setUpDefinition('type', ['value']);
+    $definitions['description'] = $this->setUpDefinition('description', ['value', 'format']);
+    $definitions['owner'] = $this->setUpDefinition('owner', [
       'target_id',
       'target_revision_id',
     ]);
 
-    $table_mapping = new DefaultTableMapping($definitions);
+    $table_mapping = new DefaultTableMapping($definitions, $definitions);
     $expected = [];
     $this->assertSame($expected, $table_mapping->getAllColumns('test'));
 
@@ -160,7 +160,7 @@ public function testGetAllColumns() {
   public function testGetFieldNames() {
     // The storage definitions are only used in getColumnNames() so we do not
     // need to provide any here.
-    $table_mapping = new DefaultTableMapping([]);
+    $table_mapping = new DefaultTableMapping([], []);
 
     // Test that requesting the list of field names for a table for which no
     // fields have been added does not fail.
@@ -188,18 +188,18 @@ public function testGetFieldNames() {
    * @covers ::getColumnNames()
    */
   public function testGetColumnNames() {
-    $definitions['test'] = $this->setUpDefinition([]);
-    $table_mapping = new DefaultTableMapping($definitions);
+    $definitions['test'] = $this->setUpDefinition('test', []);
+    $table_mapping = new DefaultTableMapping($definitions, $definitions);
     $expected = [];
     $this->assertSame($expected, $table_mapping->getColumnNames('test'));
 
-    $definitions['test'] = $this->setUpDefinition(['value']);
-    $table_mapping = new DefaultTableMapping($definitions);
+    $definitions['test'] = $this->setUpDefinition('test', ['value']);
+    $table_mapping = new DefaultTableMapping($definitions, $definitions);
     $expected = ['value' => 'test'];
     $this->assertSame($expected, $table_mapping->getColumnNames('test'));
 
-    $definitions['test'] = $this->setUpDefinition(['value', 'format']);
-    $table_mapping = new DefaultTableMapping($definitions);
+    $definitions['test'] = $this->setUpDefinition('test', ['value', 'format']);
+    $table_mapping = new DefaultTableMapping($definitions, $definitions);
     $expected = ['value' => 'test__value', 'format' => 'test__format'];
     $this->assertSame($expected, $table_mapping->getColumnNames('test'));
   }
@@ -213,7 +213,7 @@ public function testGetColumnNames() {
   public function testGetExtraColumns() {
     // The storage definitions are only used in getColumnNames() so we do not
     // need to provide any here.
-    $table_mapping = new DefaultTableMapping([]);
+    $table_mapping = new DefaultTableMapping([], []);
 
     // Test that requesting the list of field names for a table for which no
     // fields have been added does not fail.
@@ -237,13 +237,18 @@ public function testGetExtraColumns() {
   /**
    * Sets up a field storage definition for the test.
    *
+   * @param string $name
+   *   The field name.
    * @param array $column_names
    *   An array of column names for the storage definition.
    *
    * @return \Drupal\Core\Field\FieldStorageDefinitionInterface|\PHPUnit_Framework_MockObject_MockObject
    */
-  protected function setUpDefinition(array $column_names) {
-    $definition = $this->getMock('Drupal\Core\Field\FieldStorageDefinitionInterface');
+  protected function setUpDefinition($name, array $column_names) {
+    $definition = $this->getMock('Drupal\Tests\Core\Field\TestBaseFieldDefinitionInterface');
+    $definition->expects($this->any())
+      ->method('getName')
+      ->will($this->returnValue($name));
     $definition->expects($this->any())
       ->method('getColumns')
       ->will($this->returnValue(array_fill_keys($column_names, [])));
diff --git a/core/tests/Drupal/Tests/Core/Field/TestBaseFieldDefinitionInterface.php b/core/tests/Drupal/Tests/Core/Field/TestBaseFieldDefinitionInterface.php
new file mode 100644
index 0000000..f685edd
--- /dev/null
+++ b/core/tests/Drupal/Tests/Core/Field/TestBaseFieldDefinitionInterface.php
@@ -0,0 +1,17 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Tests\Core\Field\TestBaseFieldDefinitionInterface.
+ */
+
+namespace Drupal\Tests\Core\Field;
+
+use Drupal\Core\Field\FieldDefinitionInterface;
+use Drupal\Core\Field\FieldStorageDefinitionInterface;
+
+/**
+ * Defines a test interface to mock entity base field definitions.
+ */
+interface TestBaseFieldDefinitionInterface extends FieldDefinitionInterface, FieldStorageDefinitionInterface {
+}
