Jump to content

How to reset ID number?


Recommended Posts

  • 1 month later...

Well I've already been reminded about the various experience levels here :D but one way to do this (only way?) is to do it in your SQL table(s).

 

BACK UP YOUR SQL IN TOTAL!!!! (with "drop tables" so you can import right back to where you started) before you do anything like this but you can reset auto incrementing tables with this SQL command:

 

Go to the table and select the auto incrementing field. Select "operations" and you will see "AUTO_INCREMENT" and the next number. Set that to what ever you want to start with and click "go".

 

DO NOT DO THIS IF YOU ARE UNCOMFORTABLE IN ANYWAY but really there is no mystery to it and personally I think all site owners at some time should be comfortable with working within their database as it is very powerful and the heart of your Prestashop.

 

Of course the guts, veins, brain, etc. is Prestashop itself.....Merci' Beucoup! :D :D

 

Of course even if you forget to back up you can simply do the same procedure and put the old increment number in there to get back to where you were since all you have done is to edit that single table field.

Edited by DBMAN (see edit history)
Link to comment
Share on other sites

ALTER TABLE prefix_category AUTO_INCREMENT=0;

 

or TRUNCATE the table (this mean that you delete all rows from table!)

 

TRUNCATE TABLE prefix_category

 

you must paste and run this code in some SQL managers like PhpMyAdmin etc.

  • Like 1
Link to comment
Share on other sites

  • 6 years later...

Sorry for coming to the old post. I don't want to open the new post since this is related and not so important. Is there any side effects on the existing module functioning that can be found so far when resetting the category table to AUTO_INCREMENT=0 ?

I can see that some posts recommend to put it as AUTO_INCREMENT=3 (maybe due to prestashop default demo data is set to 3): 

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...