public function setPrimaryKey($name, $type = 'int') {
        $column = $this->createColumnDef($type, false);
        $column['autoIncrement'] = true;
        $column['primary'] = true;

        $this->columns[$name] = $column;

        // Add the pk index.
        $this->addIndex(Db::INDEX_PK, $name);

        return $this;
    }
public function setPrimaryKey($name, $type = 'int') {
        $column = $this->createColumnDef($type, false);
        $column['autoIncrement'] = true;
        $column['primary'] = true;

        $this->columns[$name] = $column;

        // Add the pk index.
        $this->addIndex(Db::INDEX_PK, $name);

        return $this;
    }
public function setPrimaryKey ( $ name , $ type = 'int' ) { $ column = $ this -> createColumnDef ( $ type , false ) ; $ column [ 'autoIncrement' ] = true ; $ column [ 'primary' ] = true ; $ this -> columns [ $ name ] = $ column ; // Add the pk index. $ this -> addIndex ( Db :: INDEX_PK , $ name ) ; return $ this ; }
Define the primary key in the database.

@param string $name The name of the column.
@param string $type The datatype for the column.
@return TableDef
Define the primary key in the database .