code: def add_index(self, model, *columns, **kwargs):
          
          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
docs: Create indexes.