pwiz incorrectly generates a composite unique index
Yes, `pwiz` is intended to provide a reasonable best-effort at converting the schema into the db into models, but it is not 100% perfect. As the docs say, it's purpose is to produce some basic skeleton code that should handle correct column types and foreign-keys. Things like constraints across columns with arbitrary SQL functions are not introspected currently.

That being said, constraints are not enforced on the Python side at all -- so the fact that peewee models may not reflect the constraint will not have any impact on the actual constraint that exists in the database. Ok, I agree. But I think in that case it would be better, if pwiz just do nothing (the non-text field is assigned unique), because it’s easy to overlook and it’s confusing later when you look at the models while develop. I understand that this can be difficult to fix. This is just a wish =) Thanks, I will look into it some more. So unfortunately this is a limitation of the data returned by postgresql when introspecting the set of indexes on a table. Peewee uses a rather complex query to ask postgres for metadata about the index, which includes an aggregation of the columns used in that index. Because the unique comprises a column and a function, our query only returns the column which was matched.

For now I don't think we can do much better and this will just have to be a known limitation.

Alternatives might be to try and parse the index sql to extract the columns, but in that case we still wouldn't be likely to get an accurate reflection of the actual schema since we'd also have to capture the functions being applied.
### Issue
There is the problem with pwiz: if there is a unique index across two fields, one of which is `text` or `varchar` and a value of the `lower()` function from a value of such field is taken into the unique index, then a composite unique index is not generated. Instead, the non-text field is assigned unique.

### Examples
Tables definition in PostgreSQL dialect:
```SQL
CREATE TABLE test_table
(
    id              SERIAL PRIMARY KEY,
    some_field      INTEGER,
    some_text_field TEXT
);
CREATE UNIQUE INDEX test_table_somes_uniq
    ON test_table (some_field, lower(some_text_field));

CREATE TABLE test_table2
(
    id                 SERIAL PRIMARY KEY,
    some_field         INTEGER,
    some_varchar_field VARCHAR(255)
);
CREATE UNIQUE INDEX test_table2_somes_uniq
    ON test_table2 (some_field, lower(some_varchar_field));
```
peewee models generated by pwiz:
```python
class TestTable(BaseModel):
    some_field = IntegerField(null=True, unique=True)
    some_text_field = TextField(null=True)

    class Meta:
        table_name = 'test_table'

class TestTable2(BaseModel):
    some_field = IntegerField(null=True, unique=True)
    some_varchar_field = CharField(null=True)

    class Meta:
        table_name = 'test_table2'
```
### Versions
* peewee: 3.12.0
* PostgreSQL: 11.3 