code: def change_columns(self, model, **fields):
          
          for name, field in fields.items():
              old_field = model._meta.fields.get(name, field)
              old_column_name = old_field and old_field.column_name
  
              model._meta.add_field(name, field)
  
              if isinstance(old_field, pw.ForeignKeyField):
                  self.ops.append(self.migrator.drop_foreign_key_constraint(
                      model._meta.table_name, old_column_name))
  
              if old_column_name != field.column_name:
                  self.ops.append(
                      self.migrator.rename_column(
                          model._meta.table_name, old_column_name, field.column_name))
  
              if isinstance(field, pw.ForeignKeyField):
                  on_delete = field.on_delete if field.on_delete else 'RESTRICT'
                  on_update = field.on_update if field.on_update else 'RESTRICT'
                  self.ops.append(self.migrator.add_foreign_key_constraint(
                      model._meta.table_name, field.column_name,
                      field.rel_model._meta.table_name, field.rel_field.name,
                      on_delete, on_update))
                  continue
  
              self.ops.append(self.migrator.change_column(
                  model._meta.table_name, field.column_name, field))
  
              if field.unique == old_field.unique:
                  continue
  
              if field.unique:
                  index = (field.column_name,), field.unique
                  self.ops.append(self.migrator.add_index(model._meta.table_name, *index))
                  model._meta.indexes.append(index)
              else:
                  index = (field.column_name,), old_field.unique
                  self.ops.append(self.migrator.drop_index(model._meta.table_name, *index))
                  model._meta.indexes.remove(index)
  
          return model
docs: Change fields.