<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_index(self, model, *columns, **kwargs):
 """Create indexes."""

        unique = kwargs.pop('unique', False)
        model._meta.indexes.append((columns, unique))
        columns_ = []
        for col in columns:
            field = model._meta.fields.get(col)

            if len(columns) == 1:
                field.unique = unique
                field.index = not unique

            if isinstance(field, pw.ForeignKeyField):
                col = col + '_id'

            columns_.append(col)
        self.ops.append(self.migrator.add_index(model._meta.table_name, columns_, unique=unique))
        return model