- Issue created by @SocialNicheGuru
- ๐ฉ๐ชGermany m Sami Antaki
m Sami Antaki โ made their first commit to this issueโs fork.
- @m-sami-antaki opened merge request.
- ๐บ๐ธUnited States bas123
Drupal Version: 10.2.9
Installation profile: Social (social-12.4.5)I have the following similar issue:
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: activity_notification_status, user_activity_digest, user_activity_sendThe error references: https://www.drupal.org/docs/system-requirements/setting-the-mysql-transa... โ , however that page provides information on changing the transaction isolation level, but nothing about setting the primary key
While I do have access to PHPMyAdmin and thus the database in order to set primary keys for those listed tables, I do not know which field to set for each!
For example, in the 'activity_notification_status' I tried to set the 'UID' as the Primary Key, but this was the response...
SQL query: ALTER TABLE `activity_notification_status` ADD PRIMARY KEY(`uid`); MySQL said: Documentation #1062 - Duplicate entry '3' for key 'PRIMARY'
So, if that is the case, why would the Drupal Status Report show this error?
And how would one resolve this? - ๐ฎ๐ณIndia zartab farooquee
Check Table Definitions: Use the SQL command SHOW CREATE TABLE
- ๐บ๐ธUnited States bas123
Your recommendation:
SHOW CREATE TABLE activity_notification_status
Returned the following:Your SQL query has been executed successfully. SHOW CREATE TABLE activity_notification_status; activity_notification_status CREATE TABLE `activity_notification_status` ( `u...
I can add a primary key using the PHP MySQL function under "More", which create the same code you provided and the same result:
ALTER TABLE `activity_notification_status` ADD PRIMARY KEY(`uid`); MySQL said: Documentation #1062 - Duplicate entry '3' for key 'PRIMARY'
This still shows in the Drupal Status page as:
The following table(s) do not have a primary key: activity_notification_status, user_activity_digest, user_activity_send
From the database:
- ๐ฉ๐ชGermany slowflyer
You can not create a unique PRIMARY KEY out of the existing fields in this table.
Either wait until the OS Team takes care od this issue, or create an additional field like this one:
ALTER TABLE activity_notification_status ADD my_unique_id INT NOT NULL AUTO_INCREMENT AFTER status, ADD PRIMARY KEY (my_unique_id);
(But in this case you will have trouble/error when the OS team adds a PRIMARY KEY field to the table)
- ๐บ๐ธUnited States bas123
slowflyer ,
Thank you for the explanation. Obviously, it is better to wait for the Open Social developers to correct the issue!