

def _create_index(self, model_class, fields, unique, *extra):
    tbl_name = model_class._meta.db_table
    statement = ('CREATE UNIQUE INDEX' if unique else 'CREATE INDEX')
    index_name = self.index_name(tbl_name, [f.db_column for f in fields])
    return Clause(SQL(statement), Entity(index_name), SQL('ON'), model_class.as_entity(), EnclosedClause(*[field.as_entity() for field in fields]), *extra)

dataset/ETHPy150Open coleifer/peewee/peewee.py QueryCompiler._create_index/original