framework/db/Command.php
public function addUnique($name, $table, $columns)
    {
        $sql = $this->db->getQueryBuilder()->addUnique($name, $table, $columns);

        return $this->setSql($sql)->requireTableSchemaRefresh($table);
    }
public function addUnique($name, $table, $columns)
    {
        $sql = $this->db->getQueryBuilder()->addUnique($name, $table, $columns);

        return $this->setSql($sql)->requireTableSchemaRefresh($table);
    }
public function addUnique ( $ name , $ table , $ columns ) { $ sql = $ this -> db -> getQueryBuilder ( ) -> addUnique ( $ name , $ table , $ columns ) ; return $ this -> setSql ( $ sql ) -> requireTableSchemaRefresh ( $ table ) ; }
Creates a SQL command for adding an unique constraint to an existing table.
@param string $name the name of the unique constraint.
The name will be properly quoted by the method.
@param string $table the table that the unique constraint will be added to.
The name will be properly quoted by the method.
@param string|array $columns the name of the column to that the constraint will be added on.
If there are multiple columns, separate them with commas.
The name will be properly quoted by the method.
@return $this the command object itself.
@since 2.0.13
Creates a SQL command for adding an unique constraint to an existing table .