-
Notifications
You must be signed in to change notification settings - Fork 340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setup:upgrade fails on smile_elasticsuite_optimizer_limitation PRIMARY constraint #2892
Comments
Hello @gerrits-ecommerce It seems this bug occurred after merging this PR #2148. The I have one hotfix, I need to discuss it with my team, but maybe you could test it on your project. So, If we need to have multiple rows in the In
Instead of these, we can define a unique index on the combination of So, add next lines at the end of
After that, you should run The last step, you should delete the primary key from Just click on the p.s. Maybe you will need to delete the primary index before running BR, |
Hey @vahonc, Thank you for the quick response. I tested your solution in our envoirement and it works as expected. I can now correctly run the setup:upgrade command and create new optimizers. Below is a temporary composer patch i created.
Please keep us informed when you fix the issue in the module itself. |
I am experiencing this with version 2.11 |
Hello @DemystifyDigitalLimited, First of all, the initial issue was resolved and therefore this ticket was closed. If you have the same or similar problem please create a new ticket, provide a link to the old (this) issue, and add more details, especially about the version of the Elasticsuite module, because 2.11 is very far from a clear understanding of which exactly version you are using (currently the last version is 2.11.10). Check out the solutions suggested here, if that doesn't help, as I said, feel free to create a new issue with more details. BR, |
When trying to run bin/magento setup:upgrade an error is thrown:
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '21' for key 'smile_elasticsuite_optimizer_limitation.PRIMARY', query was: ALTER TABLE
smile_elasticsuite_optimizer_limitation
ADD CONSTRAINT PRIMARY KEY (optimizer_id
)In out clients existing database there are multiple rows in the table: "smile_elasticsuite_optimizer_limitation" with the same optimizer_id value.
This causes the file following file to throw an error on the primary key contarint:
vendor/smile/elasticsuite/src/module-elasticsuite-catalog-optimizer/etc/db_schema.xml line: 106
Preconditions
Environment has exisiting optimizers with different search terms. The table "smile_elasticsuite_optimizer_limitation" has multple rows with the same optimizer_id.
Magento Version : 2.4.6
ElasticSuite Version : 2.11.0
Environment : Production and Developer
Steps to reproduce
Expected result
Actual result
The text was updated successfully, but these errors were encountered: