Hello everyone,
I’m using strapi versoin 4.3.6, and encountering with an issue while trying to implement InnoDB clustering. For that, we need the database schemas with primary keys for each, and some of the strapi schemas doesn’t contains any primary key.
Hence, I tried by altering the schemas by adding a primary keys and got success with clustering.
i.e,
ALTER TABLE tutorials_localizations_links ADD COLUMN PID INT AUTO_INCREMENT PRIMARY KEY;
ALTER TABLE stores_open_links ADD COLUMN PID INT AUTO_INCREMENT PRIMARY KEY;
But while trying to add few other collections on strapi and trying to start, I am having the below issue.
[2024-07-29 22:51:11.748] error: alter table admin_permissions_role_links
drop index PRIMARY
- ER_WRONG_AUTO_KEY: Incorrect table definition; there can be only one auto column and it must be defined as a key
Error: ER_WRONG_AUTO_KEY: Incorrect table definition; there can be only one auto column and it must be defined as a key
at Query.Sequence._packetToError
Then I tried removing my clustering, and the manually added primary keys and it succeeded.
So, is there any way that I can got this issue resolved in strapi? Because in everytime I need to push new schema changes to strapi, I will have to remove clustering and enable it again after the changes made.
Thank you.
This topic has been created from a Discord post (1267533154047102986) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord