              name=IndexName(table, columns, suffix, create_index_name),
              using=using,
              columns=self._index_columns(table, columns, col_suffixes, opclasses),
              extra=tablespace_sql,
              condition=(' WHERE ' + condition) if condition else '',
          )
  
      def _delete_index_sql(self, model, name, sql=None):
          return Statement(
              sql or self.sql_delete_index,
 
</s> remove             return Statement(
                self.sql_create_unique,
                table=table,
                name=name,
                columns=columns,
            )
 </s> add             sql = self.sql_create_unique
        return Statement(
            sql,
            table=table,
            name=name,
            columns=columns,
            condition=self._index_condition_sql(condition),
        ) </s> remove             return Statement(
                self.sql_create_unique_index,
                table=table,
                name=name,
                columns=columns,
                condition=' WHERE ' + condition,
            ) if self.connection.features.supports_partial_indexes else None
 </s> add             if not self.connection.features.supports_partial_indexes:
                return None
            sql = self.sql_create_unique_index
            condition=self._index_condition_sql(condition),
              name=IndexName(table, columns, suffix, create_index_name),
              using=using,
              columns=self._index_columns(table, columns, col_suffixes, opclasses),
              extra=tablespace_sql,
            condition=self._index_condition_sql(condition),
          )
  
      def _delete_index_sql(self, model, name, sql=None):
          return Statement(
              sql or self.sql_delete_index,
keep keep keep keep replace keep keep keep keep keep
 Refs #30913 -- Added BaseDatabaseSchemaEditor._index_condition_sql(). 
django/db/backends/base/schema.py