public function hasIndex($columns, $unique=false)
    {
        if (!is_array($columns)) {
            $columns = array($columns);
        }
        foreach ($this->getIndexes() as $index) {
            if ($index->isUnique() == $unique and $index->getColumns() == $columns) {
                return true;
            }
        }
        return false;
    }