{"record":{"id":"e30d28a06eeb7e6d","repo":"yiisoft/yii2","slug":"does-not-support-resetting-sequence","errorCode":null,"errorMessage":"{} does not support resetting sequence.","messagePattern":"(.+?) does not support resetting sequence\\.","errorType":"exception","errorClass":"yii\\base\\NotSupportedException","httpStatus":null,"severity":"error","filePath":"framework/db/QueryBuilder.php","lineNumber":1049,"sourceCode":"     */\n    public function dropDefaultValue($name, $table)\n    {\n        throw new NotSupportedException($this->db->getDriverName() . ' does not support dropping default value constraints.');\n    }\n\n    /**\n     * Creates a SQL statement for resetting the sequence value of a table's primary key.\n     * The sequence will be reset such that the primary key of the next new row inserted\n     * will have the specified value or the maximum existing value +1.\n     * @param string $tableName the name of the table whose primary key sequence will be reset\n     * @param array|string|null $value the value for the primary key of the next new row inserted. If this is not set,\n     * the next new row's primary key will have the maximum existing value +1.\n     * @return string the SQL statement for resetting sequence\n     * @throws NotSupportedException if this is not supported by the underlying DBMS\n     */\n    public function resetSequence($tableName, $value = null)\n    {\n        throw new NotSupportedException($this->db->getDriverName() . ' does not support resetting sequence.');\n    }\n\n    /**\n     * Execute a SQL statement for resetting the sequence value of a table's primary key.\n     * Reason for execute is that some databases (Oracle) need several queries to do so.\n     * The sequence is reset such that the primary key of the next new row inserted\n     * will have the specified value or the maximum existing value +1.\n     * @param string $table the name of the table whose primary key sequence is reset\n     * @param array|string|null $value the value for the primary key of the next new row inserted. If this is not set,\n     * the next new row's primary key will have the maximum existing value +1.\n     * @throws NotSupportedException if this is not supported by the underlying DBMS\n     * @since 2.0.16\n     */\n    public function executeResetSequence($table, $value = null)\n    {\n        $this->db->createCommand()->resetSequence($table, $value)->execute();\n    }\n","sourceCodeStart":1031,"sourceCodeEnd":1067,"githubUrl":"https://github.com/yiisoft/yii2/blob/66f00d18a29b520f85e8e8f1e32d1e7e7b556cac/framework/db/QueryBuilder.php#L1031-L1067","documentation":"Error \"{} does not support resetting sequence.\" thrown in yiisoft/yii2.","triggerScenarios":"Thrown at framework/db/QueryBuilder.php:1049 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"66f00d18a29b520f85e8e8f1e32d1e7e7b556cac","analyzedAt":"2026-08-17T05:17:23.470Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}