diff --git a/src/ORM/Connect/MySQLDatabase.php b/src/ORM/Connect/MySQLDatabase.php index b0633d20a..0aeb6067f 100644 --- a/src/ORM/Connect/MySQLDatabase.php +++ b/src/ORM/Connect/MySQLDatabase.php @@ -566,16 +566,6 @@ class MySQLDatabase extends Database implements TransactionManager */ public function clearTable($table) { - $this->query("DELETE FROM \"$table\""); - - // Check if resetting the auto-increment is needed - $autoIncrement = $this->preparedQuery( - 'SELECT "AUTO_INCREMENT" FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = ? AND TABLE_NAME = ?', - [ $this->getSelectedDatabase(), $table] - )->value(); - - if ($autoIncrement > 1) { - $this->query("ALTER TABLE \"$table\" AUTO_INCREMENT = 1"); - } + $this->query("TRUNCATE TABLE \"$table\""); } }