public function addPrimaryKey($name, $table, $columns)
    {
        $description = "add primary key $name on $table (" . (is_array($columns) ? implode(',', $columns) : $columns) . ')';
        $cmdPromise = $this->createCommand()->addPrimaryKey($name, $table, $columns)->execute();
        return $this->execPromise($cmdPromise, $description);
    }
public function addPrimaryKey($name, $table, $columns)
    {
        $description = "add primary key $name on $table (" . (is_array($columns) ? implode(',', $columns) : $columns) . ')';
        $cmdPromise = $this->createCommand()->addPrimaryKey($name, $table, $columns)->execute();
        return $this->execPromise($cmdPromise, $description);
    }
public function addPrimaryKey ( $ name , $ table , $ columns ) { $ description = "add primary key $name on $table (" . ( is_array ( $ columns ) ? implode ( ',' , $ columns ) : $ columns ) . ')' ; $ cmdPromise = $ this -> createCommand ( ) -> addPrimaryKey ( $ name , $ table , $ columns ) -> execute ( ) ; return $ this -> execPromise ( $ cmdPromise , $ description ) ; }
Builds and executes a SQL statement for creating a primary key.
The method will properly quote the table and column names.
@param string $name the name of the primary key constraint.
@param string $table the table that the primary key constraint will be added to.
@param string|array $columns comma separated string or array of columns that the primary key will consist of.
@return LazyPromiseInterface
Builds and executes a SQL statement for creating a primary key . The method will properly quote the table and column names .