framework/db/sqlite/Schema.php
public function findUniqueIndexes($table)
    {
        $sql = 'PRAGMA index_list(' . $this->quoteSimpleTableName($table->name) . ')';
        $indexes = $this->db->createCommand($sql)->queryAll();
        $uniqueIndexes = [];

        foreach ($indexes as $index) {
            $indexName = $index['name'];
            $indexInfo = $this->db->createCommand('PRAGMA index_info(' . $this->quoteValue($index['name']) . ')')->queryAll();

            if ($index['unique']) {
                $uniqueIndexes[$indexName] = [];
                foreach ($indexInfo as $row) {
                    $uniqueIndexes[$indexName][] = $row['name'];
                }
            }
        }

        return $uniqueIndexes;
    }
public function findUniqueIndexes($table)
    {
        $sql = 'PRAGMA index_list(' . $this->quoteSimpleTableName($table->name) . ')';
        $indexes = $this->db->createCommand($sql)->queryAll();
        $uniqueIndexes = [];

        foreach ($indexes as $index) {
            $indexName = $index['name'];
            $indexInfo = $this->db->createCommand('PRAGMA index_info(' . $this->quoteValue($index['name']) . ')')->queryAll();

            if ($index['unique']) {
                $uniqueIndexes[$indexName] = [];
                foreach ($indexInfo as $row) {
                    $uniqueIndexes[$indexName][] = $row['name'];
                }
            }
        }

        return $uniqueIndexes;
    }
public function findUniqueIndexes ( $ table ) { $ sql = 'PRAGMA index_list(' . $ this -> quoteSimpleTableName ( $ table -> name ) . ')' ; $ indexes = $ this -> db -> createCommand ( $ sql ) -> queryAll ( ) ; $ uniqueIndexes = [ ] ; foreach ( $ indexes as $ index ) { $ indexName = $ index [ 'name' ] ; $ indexInfo = $ this -> db -> createCommand ( 'PRAGMA index_info(' . $ this -> quoteValue ( $ index [ 'name' ] ) . ')' ) -> queryAll ( ) ; if ( $ index [ 'unique' ] ) { $ uniqueIndexes [ $ indexName ] = [ ] ; foreach ( $ indexInfo as $ row ) { $ uniqueIndexes [ $ indexName ] [ ] = $ row [ 'name' ] ; } } } return $ uniqueIndexes ; }
Returns all unique indexes for the given table.

Each array element is of the following structure:

```php
[
'IndexName1' => ['col1' [, ...]],
'IndexName2' => ['col2' [, ...]],
]
```

@param TableSchema $table the table metadata
@return array all unique indexes for the given table.
Returns all unique indexes for the given table .