diff --git a/core/lib/Drupal/Core/Entity/ContentEntityBase.php b/core/lib/Drupal/Core/Entity/ContentEntityBase.php
index afddb22..290a7a0 100644
--- a/core/lib/Drupal/Core/Entity/ContentEntityBase.php
+++ b/core/lib/Drupal/Core/Entity/ContentEntityBase.php
@@ -1222,22 +1222,26 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
       $fields[$entity_type->getKey('id')] = BaseFieldDefinition::create('integer')
         ->setLabel(new TranslatableMarkup('ID'))
         ->setReadOnly(TRUE)
+        ->setStorageRequired(TRUE)
         ->setSetting('unsigned', TRUE);
     }
     if ($entity_type->hasKey('uuid')) {
       $fields[$entity_type->getKey('uuid')] = BaseFieldDefinition::create('uuid')
         ->setLabel(new TranslatableMarkup('UUID'))
-        ->setReadOnly(TRUE);
+        ->setReadOnly(TRUE)
+        ->setStorageRequired(TRUE);
     }
     if ($entity_type->hasKey('revision')) {
       $fields[$entity_type->getKey('revision')] = BaseFieldDefinition::create('integer')
         ->setLabel(new TranslatableMarkup('Revision ID'))
         ->setReadOnly(TRUE)
+        ->setStorageRequired(TRUE)
         ->setSetting('unsigned', TRUE);
     }
     if ($entity_type->hasKey('langcode')) {
       $fields[$entity_type->getKey('langcode')] = BaseFieldDefinition::create('language')
         ->setLabel(new TranslatableMarkup('Language'))
+        ->setStorageRequired(TRUE)
         ->setDisplayOptions('view', [
           'region' => 'hidden',
         ])
diff --git a/core/lib/Drupal/Core/Entity/EntityFieldManager.php b/core/lib/Drupal/Core/Entity/EntityFieldManager.php
index 378a95c..c8293fa 100644
--- a/core/lib/Drupal/Core/Entity/EntityFieldManager.php
+++ b/core/lib/Drupal/Core/Entity/EntityFieldManager.php
@@ -216,7 +216,8 @@ protected function buildBaseFieldDefinitions($entity_type_id) {
           ->setDescription($this->t('A flag indicating whether this is the default translation.'))
           ->setTranslatable(TRUE)
           ->setRevisionable(TRUE)
-          ->setDefaultValue(TRUE);
+          ->setDefaultValue(TRUE)
+          ->setRequired(TRUE);
       }
     }
 
diff --git a/core/lib/Drupal/Core/Entity/EntityPublishedTrait.php b/core/lib/Drupal/Core/Entity/EntityPublishedTrait.php
index 871aceb..7b788ec 100644
--- a/core/lib/Drupal/Core/Entity/EntityPublishedTrait.php
+++ b/core/lib/Drupal/Core/Entity/EntityPublishedTrait.php
@@ -37,6 +37,7 @@ public static function publishedBaseFieldDefinitions(EntityTypeInterface $entity
       ->setDescription(new TranslatableMarkup('A boolean indicating the published state.'))
       ->setRevisionable(TRUE)
       ->setTranslatable(TRUE)
+      ->setRequired(TRUE)
       ->setDefaultValue(TRUE)];
   }
 
diff --git a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php
index f9dd0c0..9d1fc7e 100644
--- a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php
+++ b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php
@@ -1026,9 +1026,7 @@ protected function addTableDefaults(&$schema) {
    * @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'));
-  }
+  protected function processBaseTable(ContentEntityTypeInterface $entity_type, array &$schema) { }
 
   /**
    * Processes the gathered schema for a base table.
@@ -1041,9 +1039,7 @@ protected function processBaseTable(ContentEntityTypeInterface $entity_type, arr
    * @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'));
-  }
+  protected function processRevisionTable(ContentEntityTypeInterface $entity_type, array &$schema) { }
 
   /**
    * Processes the gathered schema for a base table.
@@ -1056,11 +1052,7 @@ protected function processRevisionTable(ContentEntityTypeInterface $entity_type,
    * @return array
    *   A partial schema array for the base table.
    */
-  protected function processDataTable(ContentEntityTypeInterface $entity_type, array &$schema) {
-    // Marking the respective fields as NOT NULL makes the indexes more
-    // performant.
-    $schema['fields'][$entity_type->getKey('default_langcode')]['not null'] = TRUE;
-  }
+  protected function processDataTable(ContentEntityTypeInterface $entity_type, array &$schema) { }
 
   /**
    * Processes the gathered schema for a base table.
@@ -1073,11 +1065,7 @@ protected function processDataTable(ContentEntityTypeInterface $entity_type, arr
    * @return array
    *   A partial schema array for the base table.
    */
-  protected function processRevisionDataTable(ContentEntityTypeInterface $entity_type, array &$schema) {
-    // Marking the respective fields as NOT NULL makes the indexes more
-    // performant.
-    $schema['fields'][$entity_type->getKey('default_langcode')]['not null'] = TRUE;
-  }
+  protected function processRevisionDataTable(ContentEntityTypeInterface $entity_type, array &$schema) { }
 
   /**
    * Processes the specified entity key.
@@ -1165,10 +1153,19 @@ protected function createSharedTableSchema(FieldStorageDefinitionInterface $stor
           $schema[$table_name] = $this->getSharedTableFieldSchema($storage_definition, $table_name, $column_names);
           if (!$only_save) {
             foreach ($schema[$table_name]['fields'] as $name => $specifier) {
+              // Check if the field is part of the primary keys and pass along
+              // this information when adding the field.
+              // @see \Drupal\Core\Database\Schema::addField()
+              $new_keys = [];
+              $entity_schema = $this->getEntitySchema($this->entityType);
+              if (isset($entity_schema[$table_name]['primary key']) && in_array($created_field_name, $entity_schema[$table_name]['primary key'], TRUE)) {
+                $new_keys = ['primary key' => $entity_schema[$table_name]['primary key']];
+              }
+
               // Check if the field exists because it might already have been
               // created as part of the earlier entity type update event.
               if (!$schema_handler->fieldExists($table_name, $name)) {
-                $schema_handler->addField($table_name, $name, $specifier);
+                $schema_handler->addField($table_name, $name, $specifier, $new_keys);
               }
             }
             if (!empty($schema[$table_name]['indexes'])) {
@@ -1615,35 +1612,29 @@ protected function getSharedTableFieldSchema(FieldStorageDefinitionInterface $st
     }
 
     $field_name = $storage_definition->getName();
-    $base_table = $this->storage->getBaseTable();
+    $properties = $storage_definition->getPropertyDefinitions();
 
     // A shared table contains rows for entities where the field is empty
     // (since other fields stored in the same table might not be empty), thus
     // the only columns that can be 'not null' are those for required
-    // properties of required fields. However, even those would break in the
-    // case where a new field is added to a table that contains existing rows.
-    // For now, we only hardcode 'not null' to a couple "entity keys", in order
-    // to keep their indexes optimized.
-    // @todo Revisit once we have support for 'initial' in
-    //   https://www.drupal.org/node/2346019.
-    $not_null_keys = $this->entityType->getKeys();
-    // Label fields are not necessarily required.
-    unset($not_null_keys['label']);
+    // properties of required fields.
+    $field_storage_is_required = $storage_definition->isStorageRequired();
+
     // Because entity ID and revision ID are both serial fields in the base and
     // revision table respectively, the revision ID is not known yet, when
     // inserting data into the base table. Instead the revision ID in the base
     // table is updated after the data has been inserted into the revision
     // table. For this reason the revision ID field cannot be marked as NOT
     // NULL.
-    if ($table_name == $base_table) {
-      unset($not_null_keys['revision']);
+    if ($table_name == $this->storage->getBaseTable() && $field_name == $this->entityType->getKey('revision')) {
+      $field_storage_is_required = FALSE;
     }
 
     foreach ($column_mapping as $field_column_name => $schema_field_name) {
       $column_schema = $field_schema['columns'][$field_column_name];
 
       $schema['fields'][$schema_field_name] = $column_schema;
-      $schema['fields'][$schema_field_name]['not null'] = in_array($field_name, $not_null_keys);
+      $schema['fields'][$schema_field_name]['not null'] = $field_storage_is_required && $properties[$field_column_name]->isRequired();
     }
 
     if (!empty($field_schema['indexes'])) {
@@ -1658,6 +1649,15 @@ protected function getSharedTableFieldSchema(FieldStorageDefinitionInterface $st
       $schema['foreign keys'] = $this->getFieldForeignKeys($field_name, $field_schema, $column_mapping);
     }
 
+    // Process the 'id' and 'revision' entity keys for the base and revision
+    // tables.
+    if ($field_name === $this->entityType->getKey('id') && $table_name === $this->storage->getBaseTable()) {
+      $this->processIdentifierSchema($schema, $this->entityType->getKey('id'));
+    }
+    if ($field_name === $this->entityType->getKey('revision') && $table_name === $this->storage->getRevisionTable()) {
+      $this->processIdentifierSchema($schema, $this->entityType->getKey('revision'));
+    }
+
     return $schema;
   }
 
@@ -1985,6 +1985,16 @@ protected function hasColumnChanges(FieldStorageDefinitionInterface $storage_def
           $definition_spec = array_intersect_key($definition_schema[$table]['fields'][$name], $keys);
           $stored_spec = array_intersect_key($spec, $keys);
           if ($definition_spec != $stored_spec) {
+            // Prior to Drupal 8.4.0, the last installed schema for the 'id' and
+            // 'revision' fields of all content entity types was storing an
+            // 'int' type instead of 'serial', so we need to explicitly allow
+            // this conversion.
+            // @todo Remove this in 9.0.x.
+            // @see system_update_8401()
+            // @see https://www.drupal.org/node/2841291
+            if ($definition_spec['type'] == 'serial' && $stored_spec['type'] == 'int') {
+              return FALSE;
+            }
             return TRUE;
           }
         }
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php
index 18935c1..b7d0c6d 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Core\Field\Plugin\Field\FieldType;
 
+use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
 use Drupal\Core\Field\FieldItemBase;
 use Drupal\Core\Language\LanguageInterface;
diff --git a/core/modules/aggregator/aggregator.install b/core/modules/aggregator/aggregator.install
index 84e9614..71e64a9 100644
--- a/core/modules/aggregator/aggregator.install
+++ b/core/modules/aggregator/aggregator.install
@@ -40,3 +40,13 @@ function aggregator_update_8200() {
   $field_definition->setRequired(TRUE);
   $definition_update_manager->updateFieldStorageDefinition($field_definition);
 }
+
+/**
+ * Add a default value for the 'Refresh' field for aggregator feed entities.
+ */
+function aggregator_update_8400() {
+  $definition_update_manager = \Drupal::entityDefinitionUpdateManager();
+  $field_definition = $definition_update_manager->getFieldStorageDefinition('refresh', 'aggregator_feed');
+  $field_definition->setDefaultValue(900);
+  $definition_update_manager->updateFieldStorageDefinition($field_definition);
+}
diff --git a/core/modules/aggregator/src/Entity/Feed.php b/core/modules/aggregator/src/Entity/Feed.php
index 3b14e8c..ad4049a 100644
--- a/core/modules/aggregator/src/Entity/Feed.php
+++ b/core/modules/aggregator/src/Entity/Feed.php
@@ -168,6 +168,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
     $fields['refresh'] = BaseFieldDefinition::create('list_integer')
       ->setLabel(t('Update interval'))
       ->setDescription(t('The length of time between feed updates. Requires a correctly configured cron maintenance task.'))
+      ->setDefaultValue(900)
       ->setSetting('unsigned', TRUE)
       ->setRequired(TRUE)
       ->setSetting('allowed_values', $period)
diff --git a/core/modules/comment/comment.install b/core/modules/comment/comment.install
index 47241c2..15d9921 100644
--- a/core/modules/comment/comment.install
+++ b/core/modules/comment/comment.install
@@ -114,6 +114,17 @@ function comment_schema() {
 }
 
 /**
+ * Implements hook_update_dependencies().
+ */
+function comment_update_dependencies() {
+  // comment_update_8301() needs to run before system_update_8401().
+  $dependencies['system'][8401] = array(
+    'comment' => 8301,
+  );
+  return $dependencies;
+}
+
+/**
  * Clear caches to fix Comment entity list builder and operations Views field.
  */
 function comment_update_8001() {
diff --git a/core/modules/comment/tests/src/Kernel/Views/CommentLinksTest.php b/core/modules/comment/tests/src/Kernel/Views/CommentLinksTest.php
index ffb91b0..08a326d 100644
--- a/core/modules/comment/tests/src/Kernel/Views/CommentLinksTest.php
+++ b/core/modules/comment/tests/src/Kernel/Views/CommentLinksTest.php
@@ -19,6 +19,13 @@
 class CommentLinksTest extends CommentViewsKernelTestBase {
 
   /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = ['entity_test'];
+
+  /**
    * Views used by this test.
    *
    * @var array
@@ -26,14 +33,26 @@ class CommentLinksTest extends CommentViewsKernelTestBase {
   public static $testViews = ['test_comment'];
 
   /**
+   * {@inheritdoc}
+   */
+  protected function setUp($import_test_views = TRUE) {
+    parent::setUp($import_test_views);
+
+    $this->installEntitySchema('entity_test');
+  }
+
+  /**
    * Test the comment approve link.
    */
   public function testLinkApprove() {
+    $host = EntityTest::create(['name' => $this->randomString()]);
+    $host->save();
 
     // Create an unapproved comment.
     $comment = $this->commentStorage->create([
       'uid' => $this->adminUser->id(),
       'entity_type' => 'entity_test',
+      'entity_id' => $host->id(),
       'comment_type' => 'entity_test',
       'status' => 0,
     ]);
@@ -91,8 +110,7 @@ public function testLinkApprove() {
    * Test the comment reply link.
    */
   public function testLinkReply() {
-    $this->enableModules(['field', 'entity_test']);
-    $this->installEntitySchema('entity_test');
+    $this->enableModules(['field']);
     $this->installSchema('comment', ['comment_entity_statistics']);
     $this->installConfig(['field']);
 
diff --git a/core/modules/comment/tests/src/Kernel/Views/CommentUserNameTest.php b/core/modules/comment/tests/src/Kernel/Views/CommentUserNameTest.php
index cad7b2b..22e27a8 100644
--- a/core/modules/comment/tests/src/Kernel/Views/CommentUserNameTest.php
+++ b/core/modules/comment/tests/src/Kernel/Views/CommentUserNameTest.php
@@ -4,6 +4,7 @@
 
 use Drupal\comment\Entity\Comment;
 use Drupal\Core\Session\AnonymousUserSession;
+use Drupal\entity_test\Entity\EntityTest;
 use Drupal\Tests\views\Kernel\ViewsKernelTestBase;
 use Drupal\user\Entity\Role;
 use Drupal\user\Entity\User;
@@ -36,6 +37,7 @@ protected function setUp($import_test_views = TRUE) {
 
     $this->installEntitySchema('user');
     $this->installEntitySchema('comment');
+    $this->installEntitySchema('entity_test');
     // Create the anonymous role.
     $this->installConfig(['user']);
 
@@ -67,12 +69,16 @@ protected function setUp($import_test_views = TRUE) {
     ]);
     $this->adminUser->save();
 
+    $host = EntityTest::create(['name' => $this->randomString()]);
+    $host->save();
+
     // Create some comments.
     $comment = Comment::create([
       'subject' => 'My comment title',
       'uid' => $this->adminUser->id(),
       'name' => $this->adminUser->label(),
       'entity_type' => 'entity_test',
+      'entity_id' => $host->id(),
       'comment_type' => 'entity_test',
       'status' => 1,
     ]);
@@ -85,6 +91,7 @@ protected function setUp($import_test_views = TRUE) {
       'mail' => 'test@example.com',
       'homepage' => 'https://example.com',
       'entity_type' => 'entity_test',
+      'entity_id' => $host->id(),
       'comment_type' => 'entity_test',
       'created' => 123456,
       'status' => 1,
diff --git a/core/modules/comment/tests/src/Kernel/Views/CommentViewsFieldAccessTest.php b/core/modules/comment/tests/src/Kernel/Views/CommentViewsFieldAccessTest.php
index f807c58..1ca5e43 100644
--- a/core/modules/comment/tests/src/Kernel/Views/CommentViewsFieldAccessTest.php
+++ b/core/modules/comment/tests/src/Kernel/Views/CommentViewsFieldAccessTest.php
@@ -3,6 +3,7 @@
 namespace Drupal\Tests\comment\Kernel\Views;
 
 use Drupal\comment\Entity\Comment;
+use Drupal\entity_test\Entity\EntityTest;
 use Drupal\user\Entity\User;
 use Drupal\Tests\views\Kernel\Handler\FieldFieldAccessTestBase;
 
@@ -25,6 +26,7 @@ protected function setUp($import_test_views = TRUE) {
     parent::setUp($import_test_views);
 
     $this->installEntitySchema('comment');
+    $this->installEntitySchema('entity_test');
   }
 
   /**
@@ -36,10 +38,14 @@ public function testCommentFields() {
     ]);
     $user->save();
 
+    $host = EntityTest::create(['name' => $this->randomString()]);
+    $host->save();
+
     $comment = Comment::create([
       'subject' => 'My comment title',
       'uid' => $user->id(),
       'entity_type' => 'entity_test',
+      'entity_id' => $host->id(),
       'comment_type' => 'entity_test',
     ]);
     $comment->save();
@@ -51,6 +57,7 @@ public function testCommentFields() {
       'mail' => 'test@example.com',
       'homepage' => 'https://example.com',
       'entity_type' => 'entity_test',
+      'entity_id' => $host->id(),
       'comment_type' => 'entity_test',
       'created' => 123456,
       'status' => 1,
diff --git a/core/modules/content_moderation/src/Entity/ContentModerationState.php b/core/modules/content_moderation/src/Entity/ContentModerationState.php
index cb1bc1f..937b144 100644
--- a/core/modules/content_moderation/src/Entity/ContentModerationState.php
+++ b/core/modules/content_moderation/src/Entity/ContentModerationState.php
@@ -59,14 +59,16 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
       ->setLabel(t('Workflow'))
       ->setDescription(t('The workflow the moderation state is in.'))
       ->setSetting('target_type', 'workflow')
-      ->setRequired(TRUE)
+      // @todo Make this field required in https://www.drupal.org/node/2817835.
+      //->setRequired(TRUE)
       ->setTranslatable(TRUE)
       ->setRevisionable(TRUE);
 
     $fields['moderation_state'] = BaseFieldDefinition::create('string')
       ->setLabel(t('Moderation state'))
       ->setDescription(t('The moderation state of the referenced content.'))
-      ->setRequired(TRUE)
+      // @todo Make this field required in https://www.drupal.org/node/2817835.
+      //->setRequired(TRUE)
       ->setTranslatable(TRUE)
       ->setRevisionable(TRUE);
 
diff --git a/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php b/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php
index 70a5df5..90da405 100644
--- a/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php
+++ b/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php
@@ -91,10 +91,15 @@ public function testBasicModeration($entity_type_id) {
     $workflow->getTypePlugin()->addEntityTypeAndBundle($entity_type_id, $bundle_id);
     $workflow->save();
 
+    $entity_type = $this->entityTypeManager->getDefinition($entity_type_id);
     $entity = $entity_storage->create([
-      'title' => 'Test title',
-      $this->entityTypeManager->getDefinition($entity_type_id)->getKey('bundle') => $bundle_id,
+      $entity_type->getKey('label') => 'Test title',
+      $entity_type->getKey('bundle') => $bundle_id,
     ]);
+    // Make sure we add values for all of the required fields.
+    if ($entity_type_id == 'block_content') {
+      $entity->info = $this->randomString();
+    }
     $entity->save();
     $entity = $this->reloadEntity($entity);
     $this->assertEquals('draft', $entity->moderation_state->value);
diff --git a/core/modules/menu_link_content/src/Tests/MenuLinkContentTranslationUITest.php b/core/modules/menu_link_content/src/Tests/MenuLinkContentTranslationUITest.php
index b041956..6de59c6 100644
--- a/core/modules/menu_link_content/src/Tests/MenuLinkContentTranslationUITest.php
+++ b/core/modules/menu_link_content/src/Tests/MenuLinkContentTranslationUITest.php
@@ -70,7 +70,7 @@ public function testTranslationLinkOnMenuEditForm() {
     $this->drupalGet('admin/structure/menu/manage/tools');
     $this->assertNoLink(t('Translate'));
 
-    $menu_link_content = MenuLinkContent::create(['menu_name' => 'tools', 'link' => ['uri' => 'internal:/admin/structure/menu']]);
+    $menu_link_content = MenuLinkContent::create(['menu_name' => 'tools', 'link' => ['uri' => 'internal:/admin/structure/menu'], 'title' => 'Link test']);
     $menu_link_content->save();
     $this->drupalGet('admin/structure/menu/manage/tools');
     $this->assertLink(t('Translate'));
diff --git a/core/modules/menu_link_content/tests/src/Functional/LinksTest.php b/core/modules/menu_link_content/tests/src/Functional/LinksTest.php
index 5a7121a..a701a41 100644
--- a/core/modules/menu_link_content/tests/src/Functional/LinksTest.php
+++ b/core/modules/menu_link_content/tests/src/Functional/LinksTest.php
@@ -125,6 +125,7 @@ public function testCreateLink() {
       'menu_name' => 'menu_test',
       'bundle' => 'menu_link_content',
       'link' => [['uri' => 'internal:/']],
+      'title' => 'Link test',
     ];
     $link = MenuLinkContent::create($options);
     $link->save();
diff --git a/core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentCacheabilityBubblingTest.php b/core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentCacheabilityBubblingTest.php
index c7689d9..87d1916 100644
--- a/core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentCacheabilityBubblingTest.php
+++ b/core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentCacheabilityBubblingTest.php
@@ -109,6 +109,7 @@ public function testOutboundPathAndRouteProcessing() {
       $menu_link_content = MenuLinkContent::create([
         'link' => ['uri' => $expectation['uri']],
         'menu_name' => 'tools',
+        'title' => 'Link test',
       ]);
       $menu_link_content->save();
       $tree = $menu_tree->load('tools', new MenuTreeParameters());
@@ -129,6 +130,7 @@ public function testOutboundPathAndRouteProcessing() {
       $menu_link_content = MenuLinkContent::create([
         'link' => ['uri' => $expectation['uri']],
         'menu_name' => 'tools',
+        'title' => 'Link test',
       ]);
       $menu_link_content->save();
       $expected_cacheability = $expected_cacheability->merge($expectation['cacheability']);
diff --git a/core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php b/core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php
index d4f9bd7..ba250ef 100644
--- a/core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php
+++ b/core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php
@@ -213,7 +213,7 @@ protected function processStubRow(Row $row) {
       if ($field_definition->isRequired() && is_null($row->getDestinationProperty($field_name))) {
         // Use the configured default value for this specific field, if any.
         if ($default_value = $field_definition->getDefaultValueLiteral()) {
-          $values[] = $default_value;
+          $values = reset($default_value);
         }
         else {
           // Otherwise, ask the field type to generate a sample value.
diff --git a/core/modules/node/node.install b/core/modules/node/node.install
index 4e2c240..5e8673e 100644
--- a/core/modules/node/node.install
+++ b/core/modules/node/node.install
@@ -189,7 +189,9 @@ function node_update_8002() {
   // Regenerate entity type indexes, this should drop "node__default_langcode".
   $manager->updateEntityType($manager->getEntityType('node'));
   // Regenerate "langcode" indexes, this should drop "node_field__langcode".
-  $manager->updateFieldStorageDefinition($manager->getFieldStorageDefinition('langcode', 'node'));
+  $field_definition = $manager->getFieldStorageDefinition('langcode', 'node');
+//  $field_definition->setStorageRequired(TRUE);
+  $manager->updateFieldStorageDefinition($field_definition);
 }
 
 /**
@@ -246,3 +248,16 @@ function node_update_8301() {
   $entity_type->set('entity_keys', $keys);
   $definition_update_manager->updateEntityType($entity_type);
 }
+
+/**
+ * Update the 'uid' field in order to make it required at the storage level.
+ */
+function node_update_8400() {
+  // The SQL content entity schema no longer uses entity keys to mark their
+  // corresponding fields as NOT NULL in the database, so we need to update the
+  // 'uid' field manually.
+  $definition_update_manager = \Drupal::entityDefinitionUpdateManager();
+  $field_storage_definition = $definition_update_manager->getFieldStorageDefinition('uid', 'node');
+  $field_storage_definition->setStorageRequired(TRUE);
+  $definition_update_manager->updateFieldStorageDefinition($field_storage_definition);
+}
diff --git a/core/modules/node/src/Entity/Node.php b/core/modules/node/src/Entity/Node.php
index c11a188..09585f6 100644
--- a/core/modules/node/src/Entity/Node.php
+++ b/core/modules/node/src/Entity/Node.php
@@ -385,6 +385,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
     $fields['uid'] = BaseFieldDefinition::create('entity_reference')
       ->setLabel(t('Authored by'))
       ->setDescription(t('The username of the content author.'))
+      ->setStorageRequired(TRUE)
       ->setRevisionable(TRUE)
       ->setSetting('target_type', 'user')
       ->setDefaultValueCallback('Drupal\node\Entity\Node::getCurrentUserId')
diff --git a/core/modules/node/src/NodeStorageSchema.php b/core/modules/node/src/NodeStorageSchema.php
index ac45bb5..c3b2ff2 100644
--- a/core/modules/node/src/NodeStorageSchema.php
+++ b/core/modules/node/src/NodeStorageSchema.php
@@ -35,7 +35,7 @@ protected function getSharedTableFieldSchema(FieldStorageDefinitionInterface $st
     if ($table_name == 'node_revision') {
       switch ($field_name) {
         case 'langcode':
-          $this->addSharedTableFieldIndex($storage_definition, $schema, TRUE);
+          $this->addSharedTableFieldIndex($storage_definition, $schema);
           break;
 
         case 'revision_uid':
@@ -47,9 +47,7 @@ protected function getSharedTableFieldSchema(FieldStorageDefinitionInterface $st
     if ($table_name == 'node_field_data') {
       switch ($field_name) {
         case 'promote':
-        case 'status':
         case 'sticky':
-        case 'title':
           // Improves the performance of the indexes defined
           // in getEntitySchema().
           $schema['fields'][$field_name]['not null'] = TRUE;
diff --git a/core/modules/system/src/Tests/Entity/EntityDefinitionTestTrait.php b/core/modules/system/src/Tests/Entity/EntityDefinitionTestTrait.php
index 3b1e7bd..cede279 100644
--- a/core/modules/system/src/Tests/Entity/EntityDefinitionTestTrait.php
+++ b/core/modules/system/src/Tests/Entity/EntityDefinitionTestTrait.php
@@ -155,14 +155,12 @@ protected function modifyBaseField() {
   }
 
   /**
-   * Promotes a field to an entity key.
+   * Makes a base field required.
    */
-  protected function makeBaseFieldEntityKey() {
-    $entity_type = clone $this->entityManager->getDefinition('entity_test_update');
-    $entity_keys = $entity_type->getKeys();
-    $entity_keys['new_base_field'] = 'new_base_field';
-    $entity_type->set('entity_keys', $entity_keys);
-    $this->state->set('entity_test_update.entity_type', $entity_type);
+  protected function makeBaseFieldRequired() {
+    $definitions = \Drupal::state()->get('entity_test_update.additional_base_field_definitions', []);
+    $definitions['new_base_field']->setRequired(TRUE);
+    $this->state->set('entity_test_update.additional_base_field_definitions', $definitions);
   }
 
   /**
diff --git a/core/modules/system/src/Tests/Update/EntityUpdateFilledTest.php b/core/modules/system/src/Tests/Update/EntityUpdateFilledTest.php
new file mode 100644
index 0000000..5ac0688
--- /dev/null
+++ b/core/modules/system/src/Tests/Update/EntityUpdateFilledTest.php
@@ -0,0 +1,23 @@
+<?php
+
+namespace Drupal\system\Tests\Update;
+
+/**
+ * Tests the upgrade path with existing data for various entity update issues.
+ *
+ * @see https://www.drupal.org/node/2841291
+ *
+ * @group Update
+ */
+class EntityUpdateFilledTest extends EntityUpdateTest {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setDatabaseDumpFiles() {
+    $this->databaseDumpFiles = [
+      __DIR__ . '/../../../../system/tests/fixtures/update/drupal-8.filled.standard.php.gz',
+    ];
+  }
+
+}
diff --git a/core/modules/system/src/Tests/Update/EntityUpdateTest.php b/core/modules/system/src/Tests/Update/EntityUpdateTest.php
new file mode 100644
index 0000000..4011d92
--- /dev/null
+++ b/core/modules/system/src/Tests/Update/EntityUpdateTest.php
@@ -0,0 +1,62 @@
+<?php
+
+namespace Drupal\system\Tests\Update;
+
+/**
+ * Tests the upgrade path for various entity update issues.
+ *
+ * @see https://www.drupal.org/node/2841291
+ *
+ * @group Update
+ */
+class EntityUpdateTest extends UpdatePathTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setDatabaseDumpFiles() {
+    $this->databaseDumpFiles = [
+      __DIR__ . '/../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz',
+    ];
+  }
+
+  /**
+   * Tests system_update_8401().
+   */
+  public function testSystemUpdate8401() {
+    // The installed field storage schema is wrong before running the update.
+    $key_value_store = \Drupal::keyValue('entity.storage_schema.sql');
+    $id_schema = $key_value_store->get('node.field_schema_data.nid', []);
+    $revision_id_schema = $key_value_store->get('node.field_schema_data.vid', []);
+
+    $this->assertEqual('int', $id_schema['node']['fields']['nid']['type']);
+    $this->assertEqual('int', $id_schema['node_revision']['fields']['nid']['type']);
+    $this->assertEqual('int', $revision_id_schema['node']['fields']['vid']['type']);
+    $this->assertEqual('int', $revision_id_schema['node_revision']['fields']['vid']['type']);
+
+    $this->runUpdates();
+
+    // Now check that the schema has been corrected.
+    $id_schema = $key_value_store->get('node.field_schema_data.nid', []);
+    $revision_id_schema = $key_value_store->get('node.field_schema_data.vid', []);
+
+    $this->assertEqual('serial', $id_schema['node']['fields']['nid']['type']);
+    $this->assertEqual('int', $id_schema['node_revision']['fields']['nid']['type']);
+    $this->assertEqual('int', $revision_id_schema['node']['fields']['vid']['type']);
+    $this->assertEqual('serial', $revision_id_schema['node_revision']['fields']['vid']['type']);
+
+    // Check that creating and loading a node still works as expected.
+    $node_storage = \Drupal::entityTypeManager()->getStorage('node');
+    $node = $node_storage->create([
+      'title' => 'Test update',
+      'type' => 'article',
+    ]);
+    $node->save();
+
+    $node_storage->resetCache();
+
+    $node = $node_storage->load($node->id());
+    $this->assertEqual('Test update', $node->label());
+  }
+
+}
diff --git a/core/modules/system/system.install b/core/modules/system/system.install
index 614ad9e..dcf5180 100644
--- a/core/modules/system/system.install
+++ b/core/modules/system/system.install
@@ -12,10 +12,12 @@
 use Drupal\Core\Path\AliasStorage;
 use Drupal\Core\Url;
 use Drupal\Core\Database\Database;
+use Drupal\Core\DrupalKernel;
 use Drupal\Core\Entity\ContentEntityTypeInterface;
 use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\Entity\FieldableEntityInterface;
-use Drupal\Core\DrupalKernel;
+use Drupal\Core\Entity\Sql\SqlEntityStorageInterface;
+use Drupal\Core\Field\BaseFieldDefinition;
 use Drupal\Core\Site\Settings;
 use Drupal\Core\StreamWrapper\PrivateStream;
 use Drupal\Core\StreamWrapper\PublicStream;
@@ -1927,3 +1929,47 @@ function system_update_8400(&$sandbox) {
 
   $sandbox['#finished'] = $sandbox['current'] == $sandbox['max'];
 }
+
+/**
+ * Correct the installed schema and NOT NULL handling for required base fields.
+ */
+function system_update_8401() {
+  $entity_type_manager = \Drupal::entityTypeManager();
+  $definition_update_manager = \Drupal::entityDefinitionUpdateManager();
+  /** @var \Drupal\Core\Entity\EntityLastInstalledSchemaRepositoryInterface $entity_last_installed_schema_respository */
+  $entity_last_installed_schema_respository = \Drupal::service('entity.last_installed_schema.repository');
+
+  foreach ($entity_type_manager->getDefinitions() as $entity_type_id => $entity_type) {
+    $original_entity_type = $entity_last_installed_schema_respository->getLastInstalledDefinition($entity_type_id);
+    $storage = $entity_type_manager->getStorage($entity_type_id);
+    if ($storage instanceof SqlEntityStorageInterface) {
+      foreach ($entity_last_installed_schema_respository->getLastInstalledFieldStorageDefinitions($entity_type_id) as $field_name => $field_definition) {
+        /** @var \Drupal\Core\Field\BaseFieldDefinition $field_definition */
+        if ($field_definition instanceof BaseFieldDefinition) {
+          $field_name = $field_definition->getName();
+
+          // The SQL content entity schema no longer uses entity keys to mark
+          // their corresponding fields as NOT NULL in the database, so we need
+          // to update them manually.
+          $entity_keys_names = [
+            $original_entity_type->getKey('id'),
+            $original_entity_type->getKey('uuid'),
+            $original_entity_type->getKey('revision'),
+            $original_entity_type->getKey('langcode'),
+          ];
+          if (in_array($field_name, $entity_keys_names)) {
+            $field_definition->setStorageRequired(TRUE);
+          }
+
+          if ($field_name == $original_entity_type->getKey('published')) {
+            $field_definition->setRequired(TRUE);
+          }
+
+          if ($field_definition->isStorageRequired()) {
+            $definition_update_manager->updateFieldStorageDefinition($field_definition);
+          }
+        }
+      }
+    }
+  }
+}
diff --git a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulRevChanged.php b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulRevChanged.php
index 3913075..a3fb47e 100644
--- a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulRevChanged.php
+++ b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulRevChanged.php
@@ -58,6 +58,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
       ->setLabel(t('Revision ID'))
       ->setDescription(t('The version id of the test entity.'))
       ->setReadOnly(TRUE)
+      ->setStorageRequired(TRUE)
       ->setSetting('unsigned', TRUE);
 
     $fields['revision_translation_affected'] = BaseFieldDefinition::create('boolean')
diff --git a/core/modules/user/src/UserStorageSchema.php b/core/modules/user/src/UserStorageSchema.php
index 5e590b8..35b1581 100644
--- a/core/modules/user/src/UserStorageSchema.php
+++ b/core/modules/user/src/UserStorageSchema.php
@@ -44,9 +44,6 @@ protected function getSharedTableFieldSchema(FieldStorageDefinitionInterface $st
     if ($table_name == 'users_field_data') {
       switch ($field_name) {
         case 'name':
-          // Improves the performance of the user__name index defined
-          // in getEntitySchema().
-          $schema['fields'][$field_name]['not null'] = TRUE;
           // Make sure the field is no longer than 191 characters so we can
           // add a unique constraint in MySQL.
           $schema['fields'][$field_name]['length'] = USERNAME_MAX_LENGTH;
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php
index 646ad2e..570c436 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php
@@ -772,9 +772,9 @@ public function testBaseFieldEntityKeyUpdateWithExistingData() {
     $entity = $this->entityManager->getStorage('entity_test_update')->create();
     $entity->save();
 
-    // Promote the base field to an entity key. This will trigger the addition
-    // of a NOT NULL constraint.
-    $this->makeBaseFieldEntityKey();
+    // Make the base field required. This will trigger the addition of a NOT
+    // NULL constraint.
+    $this->makeBaseFieldRequired();
 
     // Try to apply the update and verify they fail since we have a NULL value.
     $message = 'An error occurs when trying to enabling NOT NULL constraints with NULL data.';
@@ -817,4 +817,51 @@ public function testLongNameFieldIndexes() {
     $this->assertFalse($this->entityDefinitionUpdateManager->needsUpdates(), 'Entity and field schema data are correctly detected.');
   }
 
+  /**
+   * Checks that updating the main identifier field ('id') is correctly handled.
+   */
+  public function testUpdateIdentifierField() {
+    // Get the storage definition for an entity identifier, the 'id' field.
+    $storage_definition = $this->entityDefinitionUpdateManager->getFieldStorageDefinition('id', 'entity_test_update');
+
+    // Update the storage definition without any changes.
+    $this->entityDefinitionUpdateManager->updateFieldStorageDefinition($storage_definition);
+
+    // Check that creating, saving and loading an entity still works.
+    $storage = $this->entityManager->getStorage('entity_test_update');
+
+    $entity = $storage->create();
+    $entity->save();
+
+    $storage->resetCache();
+    $this->assertNotNull($storage->load($entity->id()));
+  }
+
+  /**
+   * Check that updating the revision identifier field is correctly handled.
+   */
+  public function testUpdateRevisionIdentifierField() {
+    $this->updateEntityTypeToRevisionable();
+    $this->entityDefinitionUpdateManager->applyUpdates();
+
+    // Get the storage definition for the revision identifier, the 'revision_id'
+    // field.
+    $storage_definition = $this->entityDefinitionUpdateManager->getFieldStorageDefinition('revision_id', 'entity_test_update');
+
+    // Update the storage definition without any changes.
+    $this->entityDefinitionUpdateManager->updateFieldStorageDefinition($storage_definition);
+
+    // Check that creating and saving an entity still works.
+    $this->entityManager->getStorage('entity_test_update')->create()->save();
+
+    // Check that creating, saving and loading an entity still works.
+    $storage = $this->entityManager->getStorage('entity_test_update');
+
+    $entity = $storage->create();
+    $entity->save();
+
+    $storage->resetCache();
+    $this->assertNotNull($storage->loadRevision($entity->getRevisionId()));
+  }
+
 }
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntitySchemaTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntitySchemaTest.php
index 3e285ff..8141ae6 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntitySchemaTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntitySchemaTest.php
@@ -5,9 +5,9 @@
 use Drupal\Component\Utility\SafeMarkup;
 
 /**
- * Tests adding a custom bundle field.
+ * Tests the default entity storage schema handler.
  *
- * @group system
+ * @group Entity
  */
 class EntitySchemaTest extends EntityKernelTestBase {
 
@@ -188,4 +188,63 @@ public function testCleanUpStorageDefinition() {
     $this->assertEqual($entity_type_id_count, 0, 'After uninstalling entity_test module the schema should not contains fields from entities provided by the module.');
   }
 
+  /**
+   * Tests the installed storage schema for identifier fields.
+   */
+  public function testIdentifierSchema() {
+    $this->installEntitySchema('entity_test_rev');
+
+    $key_value_store = \Drupal::keyValue('entity.storage_schema.sql');
+    $id_schema = $key_value_store->get('entity_test_rev.field_schema_data.id', []);
+    $revision_id_schema = $key_value_store->get('entity_test_rev.field_schema_data.revision_id', []);
+
+    $expected_id_schema = [
+      'entity_test_rev' => [
+        'fields' => [
+          'id' => [
+            'type' => 'serial',
+            'unsigned' => TRUE,
+            'size' => 'normal',
+            'not null' => TRUE,
+          ],
+        ],
+      ],
+      'entity_test_rev_revision' => [
+        'fields' => [
+          'id' => [
+            'type' => 'int',
+            'unsigned' => TRUE,
+            'size' => 'normal',
+            'not null' => TRUE,
+          ],
+        ],
+      ],
+    ];
+    $this->assertEquals($expected_id_schema, $id_schema);
+
+    $expected_revision_id_schema = [
+      'entity_test_rev' => [
+        'fields' => [
+          'revision_id' => [
+            'type' => 'int',
+            'unsigned' => TRUE,
+            'size' => 'normal',
+            'not null' => FALSE,
+          ],
+        ],
+      ],
+      'entity_test_rev_revision' => [
+        'fields' => [
+          'revision_id' => [
+            'type' => 'serial',
+            'unsigned' => TRUE,
+            'size' => 'normal',
+            'not null' => TRUE,
+          ],
+        ],
+      ],
+    ];
+    $this->assertEquals($expected_revision_id_schema, $revision_id_schema);
+  }
+
 }
diff --git a/core/tests/Drupal/KernelTests/Core/Menu/MenuLinkTreeTest.php b/core/tests/Drupal/KernelTests/Core/Menu/MenuLinkTreeTest.php
index 033451ac..6e57053 100644
--- a/core/tests/Drupal/KernelTests/Core/Menu/MenuLinkTreeTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Menu/MenuLinkTreeTest.php
@@ -62,9 +62,9 @@ public function testDeleteLinksInMenu() {
     \Drupal::entityManager()->getStorage('menu')->create(['id' => 'menu1'])->save();
     \Drupal::entityManager()->getStorage('menu')->create(['id' => 'menu2'])->save();
 
-    \Drupal::entityManager()->getStorage('menu_link_content')->create(['link' => ['uri' => 'internal:/menu_name_test'], 'menu_name' => 'menu1', 'bundle' => 'menu_link_content'])->save();
-    \Drupal::entityManager()->getStorage('menu_link_content')->create(['link' => ['uri' => 'internal:/menu_name_test'], 'menu_name' => 'menu1', 'bundle' => 'menu_link_content'])->save();
-    \Drupal::entityManager()->getStorage('menu_link_content')->create(['link' => ['uri' => 'internal:/menu_name_test'], 'menu_name' => 'menu2', 'bundle' => 'menu_link_content'])->save();
+    \Drupal::entityManager()->getStorage('menu_link_content')->create(['link' => ['uri' => 'internal:/menu_name_test'], 'menu_name' => 'menu1', 'bundle' => 'menu_link_content', 'title' => 'Link test'])->save();
+    \Drupal::entityManager()->getStorage('menu_link_content')->create(['link' => ['uri' => 'internal:/menu_name_test'], 'menu_name' => 'menu1', 'bundle' => 'menu_link_content', 'title' => 'Link test'])->save();
+    \Drupal::entityManager()->getStorage('menu_link_content')->create(['link' => ['uri' => 'internal:/menu_name_test'], 'menu_name' => 'menu2', 'bundle' => 'menu_link_content', 'title' => 'Link test'])->save();
 
     $output = $this->linkTree->load('menu1', new MenuTreeParameters());
     $this->assertEqual(count($output), 2);
diff --git a/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php b/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php
index aecc3e4..0dff1e8 100644
--- a/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php
@@ -74,6 +74,7 @@ protected function setUp() {
       'columns' => [
         'value' => [
           'type' => 'int',
+          'not null' => TRUE,
         ],
       ],
     ]);
@@ -397,7 +398,7 @@ public function testGetSchemaRevisionable() {
       ],
     ]);
 
-    $this->storage->expects($this->exactly(2))
+    $this->storage->expects($this->atLeastOnce())
       ->method('getRevisionTable')
       ->will($this->returnValue('entity_test_revision'));
 
@@ -500,6 +501,7 @@ public function testGetSchemaTranslatable() {
       'columns' => [
         'value' => [
           'type' => 'varchar',
+          'not null' => TRUE,
         ],
       ],
     ]);
@@ -509,6 +511,7 @@ public function testGetSchemaTranslatable() {
         'value' => [
           'type' => 'int',
           'size' => 'tiny',
+          'not null' => TRUE,
         ],
       ],
     ]);
@@ -604,7 +607,7 @@ public function testGetSchemaRevisionableTranslatable() {
       ],
     ]);
 
-    $this->storage->expects($this->exactly(3))
+    $this->storage->expects($this->atLeastOnce())
       ->method('getRevisionTable')
       ->will($this->returnValue('entity_test_revision'));
     $this->storage->expects($this->once())
@@ -618,6 +621,7 @@ public function testGetSchemaRevisionableTranslatable() {
       'columns' => [
         'value' => [
           'type' => 'int',
+          'not null' => TRUE,
         ],
       ],
     ]);
@@ -625,6 +629,7 @@ public function testGetSchemaRevisionableTranslatable() {
       'columns' => [
         'value' => [
           'type' => 'varchar',
+          'not null' => TRUE,
         ],
       ],
     ]);
@@ -633,6 +638,7 @@ public function testGetSchemaRevisionableTranslatable() {
         'value' => [
           'type' => 'int',
           'size' => 'tiny',
+          'not null' => TRUE,
         ],
       ],
     ]);
@@ -1403,6 +1409,9 @@ public function setUpStorageDefinition($field_name, array $schema) {
     $this->storageDefinitions[$field_name]->expects($this->any())
       ->method('getColumns')
       ->will($this->returnValue($schema['columns']));
+    $this->storageDefinitions[$field_name]->expects($this->any())
+      ->method('isStorageRequired')
+      ->will($this->returnValue(TRUE));
     // Add property definitions.
     if (!empty($schema['columns'])) {
       $property_definitions = [];
diff --git a/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php b/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php
index b3e339b..0d0269c 100644
--- a/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php
@@ -298,9 +298,6 @@ public function testOnEntityTypeCreate() {
       ->method('getSchema')
       ->will($this->returnValue(['columns' => $columns]));
 
-    $this->entityType->expects($this->once())
-      ->method('getKeys')
-      ->will($this->returnValue(['id' => 'id']));
     $this->entityType->expects($this->any())
       ->method('getKey')
       ->will($this->returnValueMap([
diff --git a/core/tests/Drupal/Tests/Core/Field/TestBaseFieldDefinitionInterface.php b/core/tests/Drupal/Tests/Core/Field/TestBaseFieldDefinitionInterface.php
index 953c902..afd19f7 100644
--- a/core/tests/Drupal/Tests/Core/Field/TestBaseFieldDefinitionInterface.php
+++ b/core/tests/Drupal/Tests/Core/Field/TestBaseFieldDefinitionInterface.php
@@ -4,9 +4,10 @@
 
 use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
+use Drupal\Core\Field\RequiredFieldStorageDefinitionInterface;
 
 /**
  * Defines a test interface to mock entity base field definitions.
  */
-interface TestBaseFieldDefinitionInterface extends FieldDefinitionInterface, FieldStorageDefinitionInterface {
+interface TestBaseFieldDefinitionInterface extends FieldDefinitionInterface, FieldStorageDefinitionInterface, RequiredFieldStorageDefinitionInterface {
 }
