Use the dream weaving DedeCMS system to create websites or websites Dream weaving template The test document data is often deleted, and then new document information is published again. At this time, a problem arises. The ID of the new document does not start from 1. How can I make the document ID of dedecms start from 1 again?

 The method of creating new document information ID starting from 1 after clearing and deleting all documents

The method is as follows:

1. Log in to the dream weaving background and find the system ->system settings ->SQL command line tool

Run the following commands respectively:

Clear the data in the table and delete all articles:

truncate table `dede_arctiny`;
truncate table `dede_archives`;
truncate table `dede_addonarticle`;

New article ID starts from 1:

ALTER TABLE `dede_arctype` AUTO_INCREMENT =1;

Then, the article ID will start from 1.

2. Delete the following database information:

delete from dede_addonarticle;
delete from dede_addonimages;
delete from dede_archives;
delete from dede_arctiny;
delete from dede_co_htmls;
delete from dede_co_urls;
delete from dede_co_mediaurls;
delete from dede_tagindex ;
delete from dede_taglist;
delete from dede_keywords;

Run the above statement directly in the background, which means to clear the articles and the previously collected records

TRUNCATE TABLE `dede_archives;

Then run the above statement directly in the background

TRUNCATE TABLE `dede_archives;

Use the SQL command to empty the table. The ID will start at 1.

The method of setting ID from 1 after deleting a dede article

Only three SQL statements need to be executed:

ALTER TABLE `dede_archives` AUTO_INCREMENT =1; // Main table
ALTER TABLE `dede_arctiny` AUTO_INCREMENT =1; // Micro watch
ALTER TABLE `dede_addonarticle` AUTO_INCREMENT =1; // Additional Tables

Many people only set the dede_archives id of the main table to 1, which is not enough. The micro table dede_artiny and the attached table dede_addonarticle must be executed at the same time so that the ID can start from 1.

ALTER TABLE `dede_archives` AUTO_INCREMENT =1;
ALTER TABLE `dede_arctiny` AUTO_INCREMENT =1;
ALTER TABLE `dede_addonarticle` AUTO_INCREMENT =1;

Post reply

Can't comment until