db\mysql\QueryBuilder resetSequence()

resetSequence() public method

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 1.

public string resetSequence ( $tableName, $value = null )
$tableName string

The name of the table whose primary key sequence will be reset

$value mixed

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 a value 1.

return string

The SQL statement for resetting sequence

throws yii\base\InvalidParamException

if the table does not exist or there is no sequence associated with the table.

doc_Yii
2016-10-30 16:58:30
Comments
Leave a Comment

Please login to continue.