Ubercart order number start at 1. How can I set the order number to start with a larger number, e.g. 100001?
Run this query against your database:
ALTER TABLE uc_orders AUTO_INCREMENT = 100001;
The next record added will use 100001 as the ID.
Or for Postgres (Thanks @Mołot for the heads up):
SELECT setval('SEQUENCE_ID', 100001, FALSE);
You'll need to replace
SEQUENCE_ID with the appropriate sequence id for the
For sequence-enabled databases that lack setval (like Oracle, at least in some versions), you can:
ALTER SEQUENCE schema.sequence_id INCREMENT BY 1000; SELECT schema.sequence_id.NEXTVAL FROM dual; ALTER SEQUENCE schema.sequence_id INCREMENT BY 1;
Other approach is to make order number not sequential. You may dislike the idea that user can count total orders between his orders - if he orders some minor stuff every month, he knows your monthly order volume, and that's bad. "Sanitization" of order number to prevent this was discussed here on ubercart.org.