yiisoft/yii2 · error · yii\base\NotSupportedException
{} does not support resetting sequence.
Error message
{} does not support resetting sequence. What it means
Error "{} does not support resetting sequence." thrown in yiisoft/yii2.
Source
Thrown at framework/db/QueryBuilder.php:1049
*/
public function dropDefaultValue($name, $table)
{
throw new NotSupportedException($this->db->getDriverName() . ' does not support dropping default value constraints.');
}
/**
* Creates a SQL statement for resetting the sequence value of a table's primary key.
* The sequence will be reset such that the primary key of the next new row inserted
* will have the specified value or the maximum existing value +1.
* @param string $tableName the name of the table whose primary key sequence will be reset
* @param array|string|null $value the value for the primary key of the next new row inserted. If this is not set,
* the next new row's primary key will have the maximum existing value +1.
* @return string the SQL statement for resetting sequence
* @throws NotSupportedException if this is not supported by the underlying DBMS
*/
public function resetSequence($tableName, $value = null)
{
throw new NotSupportedException($this->db->getDriverName() . ' does not support resetting sequence.');
}
/**
* Execute a SQL statement for resetting the sequence value of a table's primary key.
* Reason for execute is that some databases (Oracle) need several queries to do so.
* The sequence is reset such that the primary key of the next new row inserted
* will have the specified value or the maximum existing value +1.
* @param string $table the name of the table whose primary key sequence is reset
* @param array|string|null $value the value for the primary key of the next new row inserted. If this is not set,
* the next new row's primary key will have the maximum existing value +1.
* @throws NotSupportedException if this is not supported by the underlying DBMS
* @since 2.0.16
*/
public function executeResetSequence($table, $value = null)
{
$this->db->createCommand()->resetSequence($table, $value)->execute();
}
View on GitHub (pinned to 66f00d18a2)
When it happens
Trigger: Thrown at framework/db/QueryBuilder.php:1049 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of yiisoft/yii2@66f00d18a2 (2026-08-17).
Data as JSON: /api/errors/e30d28a06eeb7e6d.
Report an issue: GitHub.