src/Titon/Db/Driver/Schema.php
public function addUnique($column, $options = []) {
        $symbol = '';
        $index = $column;

        if (is_array($options)) {
            if (isset($options['constraint'])) {
                $symbol = $options['constraint'];
            }

            if (isset($options['index'])) {
                $index = $options['index'];
            }
        } else if (is_string($options)) {
            $index = $options;
        }

        if (empty($this->_uniqueKeys[$index])) {
            $this->_uniqueKeys[$index] = [
                'index' => $index,
                'constraint' => $symbol,
                'columns' => [$column]
            ];
        } else {
            $this->_uniqueKeys[$index]['columns'][] = $column;
        }
    }
public function addUnique($column, $options = []) {
        $symbol = '';
        $index = $column;

        if (is_array($options)) {
            if (isset($options['constraint'])) {
                $symbol = $options['constraint'];
            }

            if (isset($options['index'])) {
                $index = $options['index'];
            }
        } else if (is_string($options)) {
            $index = $options;
        }

        if (empty($this->_uniqueKeys[$index])) {
            $this->_uniqueKeys[$index] = [
                'index' => $index,
                'constraint' => $symbol,
                'columns' => [$column]
            ];
        } else {
            $this->_uniqueKeys[$index]['columns'][] = $column;
        }
    }
public function addUnique ( $ column , $ options = [ ] ) { $ symbol = '' ; $ index = $ column ; if ( is_array ( $ options ) ) { if ( isset ( $ options [ 'constraint' ] ) ) { $ symbol = $ options [ 'constraint' ] ; } if ( isset ( $ options [ 'index' ] ) ) { $ index = $ options [ 'index' ] ; } } else if ( is_string ( $ options ) ) { $ index = $ options ; } if ( empty ( $ this -> _uniqueKeys [ $ index ] ) ) { $ this -> _uniqueKeys [ $ index ] = [ 'index' => $ index , 'constraint' => $ symbol , 'columns' => [ $ column ] ] ; } else { $ this -> _uniqueKeys [ $ index ] [ 'columns' ] [ ] = $ column ; } }
Add a unique key for a column.
Multiple unique keys can exist, so group by index.

@param string $column
@param string|array $options {
@type string $constraint    Provide a name to reference the constraint by
@type string $index         Custom name for the index key, defaults to the column name
}
@return $this
Add a unique key for a column . Multiple unique keys can exist so group by index .