• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/internals/database/helper/mysql.php
  • Класс: BitrixTasksInternalsDataBaseHelper
  • Вызов: Helper::resetAutoIncrement
static function resetAutoIncrement($tableName, $startIndex = 1)
{
	$startIndex = intval($startIndex);
	if($startIndex <= 0 || !strlen($tableName))
		return false;

	$dbConnection = MainHttpApplication::getConnection();
	$dbHelper = $dbConnection->getSqlHelper();

	$tableName = $dbHelper->forSql(trim($tableName));

	$dbConnection->query('alter table '.$tableName.' AUTO_INCREMENT = '.$startIndex);

	return true;
}