      output = []
  
      qn = connection.ops.quote_name
      for f in model._meta.fields:
          if f.db_index and not ((f.primary_key or f.unique) and backend.autoindexes_primary_keys):
              unique = f.unique and 'UNIQUE ' or ''
              tablespace = f.db_tablespace or model._meta.db_tablespace
              if tablespace and backend.supports_tablespaces:
                  tablespace_sql = ' ' + connection.ops.tablespace_sql(tablespace)
              else:
 
</s> remove             if tablespace and backend.supports_tablespaces:
 </s> add             if tablespace and connection.features.supports_tablespaces: </s> remove             if tablespace and backend.supports_tablespaces and backend.autoindexes_primary_keys:
 </s> add             if tablespace and connection.features.supports_tablespaces and connection.features.autoindexes_primary_keys: </s> remove     if opts.db_tablespace and backend.supports_tablespaces:
 </s> add     if opts.db_tablespace and connection.features.supports_tablespaces: </s> remove         if f.unique and (not f.primary_key or backend.allows_unique_and_pk):
 </s> add         if f.unique and (not f.primary_key or connection.features.allows_unique_and_pk): </s> remove         if tablespace and backend.supports_tablespaces and (f.unique or f.primary_key) and backend.autoindexes_primary_keys:
 </s> add         if tablespace and connection.features.supports_tablespaces and (f.unique or f.primary_key) and connection.features.autoindexes_primary_keys:
        if f.db_index and not ((f.primary_key or f.unique) and connection.features.autoindexes_primary_keys):
      output = []
  
      qn = connection.ops.quote_name
      for f in model._meta.fields:
        if f.db_index and not ((f.primary_key or f.unique) and connection.features.autoindexes_primary_keys):
              unique = f.unique and 'UNIQUE ' or ''
              tablespace = f.db_tablespace or model._meta.db_tablespace
              if tablespace and backend.supports_tablespaces:
                  tablespace_sql = ' ' + connection.ops.tablespace_sql(tablespace)
              else:
keep keep keep keep replace keep keep keep keep keep
 Implemented BaseDatabaseFeatures and changed all code to access it -- connection.features.foo instead of backend.foo

git-svn-id: http://code.djangoproject.com/svn/django/trunk@5974 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
django/core/management/sql.py