0

i finish to do a lot of test so now i'd like to reset order progressive number and invoices.. Anyone can help me with mysql code for doing this reset? Thanks!

2
  • You want to keep the old orders?or it's fine to delete them? Jun 2, 2022 at 4:47
  • For deleting all order i have a plugin and is not a problem. I'd like to start from order 0001 and invoice 0001 after deleting all orders. Thanks Jun 2, 2022 at 9:14

2 Answers 2

0

Truncate the tables instead of deleting all the rows.

TRUNCATE TABLE sales_order
TRUNCATE TABLE sales_invoice

Truncate all the order & invoice related tables

or you can use the below query to alter the auto_increment value

ALTER TABLE tablename AUTO_INCREMENT = 1

0

If you want to reset Increment value

Truncate sequence_order_* and sequence_invoice_* tables

If you want to change logic (like prefix/suffix) you can also review data in sales_sequence_profile and sales_sequence_meta

Also might be useful table to understand is eav_entity_type

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.