Closed ADDISON74 closed 3 years ago
Here is the code from ImaClean for resetting the table:
$model = Mage::getModel('defcon2imaclean/imaclean'); $resource = $model->getResource(); $connection = $resource->getReadConnection(); $connection->truncateTable($resource->getMainTable()); $connection->changeTableAutoIncrement($resource->getMainTable(), 1);
Please set auto_increment value to 1 after truncating the table.
Checking the database after pressing the Reset button the table auto_increment value is set to 1.
truncate already resets auto_increment:
https://www.mysqltutorial.org/mysql-reset-auto-increment/#:~:text=Using%20TRUNCATE%20TABLE%20statement,auto%2Dincrement%20value%20to%20zero.&text=By%20using%20the%20TRUNCATE%20TABLE,auto%2Dincrement%20value%20to%20zero.
there's no need for a specific instruction, at least in mysql
Here is the code from ImaClean for resetting the table:
Please set auto_increment value to 1 after truncating the table.