Hello Magento Friends,

Welcome to Magento 2 Tutorials by MageComp. Today’s subject matter is How to Fix Unique Constraint Violation Found in Magento 2.

Magento 2 store merchants generally come across errors like “Unique constraint violation found” in the backend. Look at the below image.

unique constraint error

The Unique Constraint Violation Found error usually occurs while adding categories, products, items, or creating new orders. The reason for this error can be the creation of duplicate values in the database table.

Let find out the solution for, How to Fix Unique Constraint Violation Found in Magento 2.

Steps to Fix Unique Constraint Violation Found in Magento 2:

The issue is related to the sequences table. So check the table of sequence_order_0 and sequence_order_1. 

sequence table

sequence_value column should be auto_increment and set primary key.

Conclusion: 

Hence, this way you can Fix Unique Constraint Violation Found in Magento 2. In case of any issue, reach out to me via the comment section. Share the article and help your friends to fix the problem.

Happy Reading!

Click to rate this post!
[Total: 12 Average: 4.7]