Postgres::alterSequence PHP Method

alterSequence() public method

Alters a sequence
public alterSequence ( $sequence, $name, $comment, $owner = null, $schema = null, $increment = null, $minvalue = null, $maxvalue = null, $restartvalue = null, $cachevalue = null, $cycledvalue = null, $startvalue = null ) : -2
$sequence The name of the sequence
$name The new name for the sequence
$comment The comment on the sequence
$owner The new owner for the sequence
$schema The new schema for the sequence
$increment The increment
$minvalue The min value
$maxvalue The max value
$restartvalue The starting value
$cachevalue The cache value
$cycledvalue True if cycled, false otherwise
$startvalue The sequence start value when issueing a restart
return -2
    function alterSequence($sequence, $name, $comment, $owner = null, $schema = null, $increment = null, $minvalue = null, $maxvalue = null, $restartvalue = null, $cachevalue = null, $cycledvalue = null, $startvalue = null)
    {
        $this->fieldClean($sequence);
        $data = $this->getSequence($sequence);
        if ($data->recordCount() != 1) {
            return -2;
        }
        $status = $this->beginTransaction();
        if ($status != 0) {
            $this->rollbackTransaction();
            return -1;
        }
        $status = $this->_alterSequence($data, $name, $comment, $owner, $schema, $increment, $minvalue, $maxvalue, $restartvalue, $cachevalue, $cycledvalue, $startvalue);
        if ($status != 0) {
            $this->rollbackTransaction();
            return $status;
        }
        return $this->endTransaction();
    }
Postgres