Postgres::alterTable PHP Method

alterTable() public method

Alter table properties
public alterTable ( $table, $name, $owner, $schema, $comment, $tablespace ) : -2
$table The name of the table
$name The new name for the table
$owner The new owner for the table
$schema The new schema for the table
$comment The comment on the table
$tablespace The new tablespace for the table ('' means leave as is)
return -2
    function alterTable($table, $name, $owner, $schema, $comment, $tablespace)
    {
        $data = $this->getTable($table);
        if ($data->recordCount() != 1) {
            return -2;
        }
        $status = $this->beginTransaction();
        if ($status != 0) {
            $this->rollbackTransaction();
            return -1;
        }
        $status = $this->_alterTable($data, $name, $owner, $schema, $comment, $tablespace);
        if ($status != 0) {
            $this->rollbackTransaction();
            return $status;
        }
        return $this->endTransaction();
    }
Postgres