DUPLICATE KEY in orders id

What is going on???

i try to import from csv 3 orders for test
i exported tha orders csv
i kept only the 3 rows
i change telephones names and emails

and i try to import them for test.

NOW MY ESHOP is broken and i get message Duplicate id for order #17xxxxxxxxxxx

How is there is no Check for duplicate keys in import?
How mysql allows to insert duplicate key and how to fix???
i dont see the orders in my panel.

Remove The Import orders is very dangerus
how to fix now???

Looks like you reached maximum value of the order_id column with the MEDIUMINT type.

Try to log in the phpMyAdmin and go to the cscart_orders table and change the type of the order_id column to INT (11)

Then you should also make the same changes for all tables with the order_id column

1 Like

i fixed like
FLUSH TABLES;
SHOW TABLE STATUS LIKE ‘cscart_orders’;

then i did
ALTER TABLE cscart_orders ENGINE = InnoDB;
ALTER TABLE cscart_orders AUTO_INCREMENT = 27038; //my last id+1
ALTER TABLE cscart_orders ENGINE = MyISAM;

everything is okey again.
you soudl fix the bug when i try to import orders to check for duplicated key and provide a notification to user.

1 Like