public function unique(string $indexName = null)
    {
        $this->indexName = $indexName ?? $this->tableName . '_' . $this->name . '_unique_index';
        $this->isUnique  = true;

        return $this;
    }
public function unique(string $indexName = null)
    {
        $this->indexName = $indexName ?? $this->tableName . '_' . $this->name . '_unique_index';
        $this->isUnique  = true;

        return $this;
    }
public function unique ( string $ indexName = null ) { $ this -> indexName = $ indexName ?? $ this -> tableName . '_' . $ this -> name . '_unique_index' ; $ this -> isUnique = true ; return $ this ; }
Defines an unique index constraint for the column.

@param string|null $indexName Defaults to {column-name}_unique_index

@return static
Defines an unique index constraint for the column .