search_api_db_search_index_search_api_language does not have a primary key

Created on 19 July 2023, 12 months ago
Updated 7 October 2023, 9 months ago

Problem/Motivation

Since upgrading to D10, we are seeing this error in the status report:

Transaction isolation level
READ-COMMITTED
For this to work correctly, all tables must have a primary key. The following table(s) do not have a primary key: search_api_db_search_index_search_api_language. See the setting MySQL transaction isolation level page for more information.

I have looked at other issues related to setting a primary key and they seem to have been solved by previous releases and hook_update_n implementations, but this table still doesn't have a primary key on our setup.

🐛 Bug report
Status

Postponed: needs info

Version

1.0

Component

Database backend

Created by

🇺🇸United States scotwith1t Birmingham, AL

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @scotwith1t
  • 🇫🇮Finland tvalimaa

    I got message:
    For this to work correctly, all tables must have a primary key. The following table(s) do not have a primary key: search_api_db_fulltext_1.

    What I did was custom update_hook for custom module.install file

    function mymodule_update_10001() {
      \Drupal::database()->schema()->addPrimaryKey('search_api_db_fulltext_1', ['item_id']);
    }
    
  • Status changed to Postponed: needs info 9 months ago
  • 🇦🇹Austria drunken monkey Vienna, Austria

    This seems to be a result of some previous error when first creating the search index. Normally, that table should have a primary key.
    Unless you can reproduce this problem from a new installation, please just add the primary key (on item_id, value) manually.

Production build 0.69.0 2024