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. |
Please login to continue.