diff --git a/search_api_db/src/Plugin/search_api/backend/Database.php b/search_api_db/src/Plugin/search_api/backend/Database.php
index bba8022..838b87e 100644
--- a/search_api_db/src/Plugin/search_api/backend/Database.php
+++ b/search_api_db/src/Plugin/search_api/backend/Database.php
@@ -565,11 +565,6 @@ public function addIndex(IndexInterface $index) {
       $db_info['field_tables'] = array();
       $db_info['index_table'] = $index_table;
       $this->getKeyValueStore()->set($index->id(), $db_info);
-
-      // If there are no fields, we are done now.
-      if (!$index->getFields()) {
-        return;
-      }
     }
     // The database operations might throw PDO or other exceptions, so we catch
     // them all and re-wrap them appropriately.
diff --git a/search_api_db/tests/src/Kernel/BackendTest.php b/search_api_db/tests/src/Kernel/BackendTest.php
index e491942..6f99f55 100644
--- a/search_api_db/tests/src/Kernel/BackendTest.php
+++ b/search_api_db/tests/src/Kernel/BackendTest.php
@@ -134,8 +134,21 @@ protected function checkMultiValuedInfo() {
     $db_info = $this->getIndexDbInfo();
     $field_info = $db_info['field_tables'];
 
-    $fields = array('name', 'body', 'type', 'keywords', 'category', 'width');
-    $multi_valued = array('name', 'body', 'keywords');
+    $fields = array(
+      'name',
+      'body',
+      'type',
+      'keywords',
+      'category',
+      'width',
+      'search_api_datasource',
+      'search_api_language',
+    );
+    $multi_valued = array(
+      'name',
+      'body',
+      'keywords',
+    );
     foreach ($fields as $field_id) {
       $this->assertArrayHasKey($field_id, $field_info, "Field info saved for field $field_id.");
       if (in_array($field_id, $multi_valued)) {
@@ -459,6 +472,24 @@ protected function regressionTest2511860() {
   /**
    * {@inheritdoc}
    */
+  protected function checkIndexWithoutFields() {
+    $index = parent::checkIndexWithoutFields();
+
+    $expected = array(
+      'search_api_datasource',
+      'search_api_language',
+    );
+    $db_info = $this->getIndexDbInfo($index->id());
+    $info_fields = array_keys($db_info['field_tables']);
+    sort($info_fields);
+    $this->assertEquals($expected, $info_fields);
+
+    return $index;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
   protected function checkModuleUninstall() {
     $db_info = $this->getIndexDbInfo();
     $normalized_storage_table = $db_info['index_table'];
@@ -510,12 +541,17 @@ protected function checkModuleUninstall() {
   /**
    * Retrieves the database information for the test index.
    *
+   * @param string|null $index_id
+   *   (optional) The ID of the index whose database information should be
+   *   retrieved.
+   *
    * @return array
    *   The database information stored by the backend for the test index.
    */
-  protected function getIndexDbInfo() {
+  protected function getIndexDbInfo($index_id = NULL) {
+    $index_id = $index_id ?: $this->indexId;
     return \Drupal::keyValue(BackendDatabase::INDEXES_KEY_VALUE_STORE_ID)
-      ->get($this->indexId);
+      ->get($index_id);
   }
 
 }
diff --git a/tests/src/Kernel/BackendTestBase.php b/tests/src/Kernel/BackendTestBase.php
index 92c153f..26a3813 100644
--- a/tests/src/Kernel/BackendTestBase.php
+++ b/tests/src/Kernel/BackendTestBase.php
@@ -62,6 +62,12 @@ public function setUp() {
     $this->installEntitySchema('entity_test');
     $this->installConfig('search_api_test_example_content');
 
+    // Set the tracking page size so tracking will work properly.
+    \Drupal::configFactory()
+      ->getEditable('search_api.settings')
+      ->set('tracking_page_size', 100)
+      ->save();
+
     // Do not use a batch for tracking the initial items after creating an
     // index when running the tests via the GUI. Otherwise, it seems Drupal's
     // Batch API gets confused and the test fails.
@@ -102,6 +108,8 @@ public function testFramework() {
     $this->searchNoResults();
     $this->regressionTests2();
 
+    $this->checkIndexWithoutFields();
+
     $this->checkModuleUninstall();
   }
 
@@ -996,6 +1004,42 @@ protected function regressionTests2616804() {
   }
 
   /**
+   * Checks the correct handling of an index without fields.
+   *
+   * @return \Drupal\search_api\IndexInterface
+   *   The created test index.
+   */
+  protected function checkIndexWithoutFields() {
+    $index = Index::create(array(
+      'id' => 'test_index_2',
+      'name' => 'Test index 2',
+      'status' => TRUE,
+      'server' => $this->serverId,
+      'datasource_settings' => array(
+        'entity:entity_test' => array(
+          'plugin_id' => 'entity:entity_test',
+          'settings' => array(),
+        ),
+      ),
+      'tracker_settings' => array(
+        'default' => array(
+          'plugin_id' => 'default',
+          'settings' => array(),
+        ),
+      ),
+    ));
+    $index->save();
+
+    $indexed_count = $index->indexItems();
+    $this->assertEquals(count($this->entities), $indexed_count);
+
+    $search_count = $index->query()->execute()->getResultCount();
+    $this->assertEquals(count($this->entities), $search_count);
+
+    return $index;
+  }
+
+  /**
    * Asserts ignored fields from a set of search results.
    *
    * @param \Drupal\search_api\Query\ResultSetInterface $results
