yii\db\pgsql\Schema::findUniqueIndexes PHP Method

findUniqueIndexes() public method

Each array element is of the following structure: php [ 'IndexName1' => ['col1' [, ...]], 'IndexName2' => ['col2' [, ...]], ]
public findUniqueIndexes ( yii\db\TableSchema $table ) : array
$table yii\db\TableSchema the table metadata
return array all unique indexes for the given table.
    public function findUniqueIndexes($table)
    {
        $uniqueIndexes = [];
        $rows = $this->getUniqueIndexInformation($table);
        foreach ($rows as $row) {
            $column = $row['columnname'];
            if (!empty($column) && $column[0] === '"') {
                // postgres will quote names that are not lowercase-only
                // https://github.com/yiisoft/yii2/issues/10613
                $column = substr($column, 1, -1);
            }
            $uniqueIndexes[$row['indexname']][] = $column;
        }
        return $uniqueIndexes;
    }