diff --git a/search_api.install b/search_api.install
index 3ed7dd8..2777f88 100644
--- a/search_api.install
+++ b/search_api.install
@@ -30,7 +30,7 @@ function search_api_schema() {
       'item_id' => array(
         'description' => 'The unique identifier of this item',
         'type' => 'varchar',
-        'length' => 50,
+        'length' => 150,
         'not null' => TRUE,
       ),
       'changed' => array(
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 a419ccc..20142c0 100644
--- a/search_api_db/src/Plugin/search_api/backend/Database.php
+++ b/search_api_db/src/Plugin/search_api/backend/Database.php
@@ -692,7 +692,7 @@ class Database extends BackendPluginBase {
         'fields' => array(
           'item_id' => array(
             'type' => 'varchar',
-            'length' => 50,
+            'length' => 150,
             'description' => 'The primary identifier of the item',
             'not null' => TRUE,
           ),
@@ -944,7 +944,7 @@ class Database extends BackendPluginBase {
           'fields' => array(
             'item_id' => array(
               'type' => 'varchar',
-              'length' => 50,
+              'length' => 150,
               'description' => 'The primary identifier of the item',
               'not null' => TRUE,
             ),
diff --git a/tests/src/Kernel/EntityStringIdTest.php b/tests/src/Kernel/EntityStringIdTest.php
index e0b148f..59ed4c7 100644
--- a/tests/src/Kernel/EntityStringIdTest.php
+++ b/tests/src/Kernel/EntityStringIdTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\search_api\Kernel;
 
+use Drupal\Component\Uuid\Php;
 use Drupal\entity_test\Entity\EntityTestStringId;
 use Drupal\KernelTests\KernelTestBase;
 use Drupal\search_api\Entity\Index;
@@ -150,6 +151,8 @@ class EntityStringIdTest extends KernelTestBase {
       array('short_string_id'),
       // String ID that is not a valid machine name.
       array('http://drupal.org'),
+      // String ID generated randomly. This is to test the length of the Id.
+      [(new Php())->generate()],
     );
   }
 }
