contact_message table does not have a primary key

Created on 7 July 2023, over 1 year ago
Updated 22 March 2024, 8 months ago

Problem/Motivation

After upgrading to Drupal 10, I see this error message on 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: contact_message. See the setting MySQL transaction isolation level β†’ page for more information.

Proposed resolution

Add a primary key to the contact_message table

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States cindytwilliams Nashville, TN

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

Comments & Activities

  • Issue created by @cindytwilliams
  • πŸ‡ͺπŸ‡ΈSpain rodrigoaguilera Barcelona

    The related issue creates the table with a primary key. I guess what needs to be done in this issue is to write an hook_update_N to add the id a primary key.

  • πŸ‡¬πŸ‡§United Kingdom mylocaltrades

    Following. This error message I have on a number of sites where contact storage module was used then uninstalled in favour of the webform module. So although these sites no longer use this module and it has been uninstalled (I even tried installing then uninstalling that latest version) this error still exists in the status reports page

  • Likewise, mylocaltrades. I uninstalled and removed contact storage. But it did not remove the contact_message table.

    I manually deleted the table which removed the error message, of course.

    This perhaps is another issue with the contact storage module which could be addressed here or in another issue. Perhaps it is desirable to maintain the message storage even after removal of the module, or the uninstallation of the module should remove the table.

    I will probably revert to webform, so it is no longer of concern to me.

  • πŸ‡«πŸ‡·France andypost

    @GrahamShepherd see related πŸ› Properly uninstall entity types Needs work

  • Same here on 10.1.6 with PHP 8.1.26. I don't have the Contact Storage module installed any more but keep getting the error message. I was wondering whether the missing key could be the reason why "init_commands' => [ 'isolation_level ..." from settings.php doesn't work and READ COMMITTED can only be set manually - whereupon the error appears in admin/reports/status#error.

  • The issue persists on D10.2.4 with MariaDB and PHP 8.3 although I was able to install, enable, uninstall, and remove the contact_storage module with Patch #23 from elsewhere (mentioned above). Could somebody please be so kind and provide here for a non-database specialist like me the/a possible sql command(s) for deleting the leftovers that still trigger the error message and block the database configuration?

  • Same error in the status report - is there any patch or solution available?

Production build 0.71.5 2024