          if f.unique and (not f.primary_key or backend.allows_unique_and_pk):
              field_output.append(style.SQL_KEYWORD('UNIQUE'))
          if f.primary_key:
              field_output.append(style.SQL_KEYWORD('PRIMARY KEY'))
          if tablespace and backend.supports_tablespaces and (f.unique or f.primary_key) and backend.autoindexes_primary_keys:
              # We must specify the index tablespace inline, because we
              # won't be generating a CREATE INDEX statement for this field.
              field_output.append(connection.ops.tablespace_sql(tablespace, inline=True))
          if f.rel:
              if f.rel.to in known_models:
 
</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 backend.autoindexes_primary_keys:
 </s> add             if tablespace and connection.features.supports_tablespaces and connection.features.autoindexes_primary_keys: </s> remove         if f.db_index and not ((f.primary_key or f.unique) and backend.autoindexes_primary_keys):
 </s> add         if f.db_index and not ((f.primary_key or f.unique) and connection.features.autoindexes_primary_keys): </s> remove             if tablespace and backend.supports_tablespaces:
 </s> add             if tablespace and connection.features.supports_tablespaces:
        if tablespace and connection.features.supports_tablespaces and (f.unique or f.primary_key) and connection.features.autoindexes_primary_keys:
          if f.unique and (not f.primary_key or backend.allows_unique_and_pk):
              field_output.append(style.SQL_KEYWORD('UNIQUE'))
          if f.primary_key:
              field_output.append(style.SQL_KEYWORD('PRIMARY KEY'))
        if tablespace and connection.features.supports_tablespaces and (f.unique or f.primary_key) and connection.features.autoindexes_primary_keys:
              # We must specify the index tablespace inline, because we
              # won't be generating a CREATE INDEX statement for this field.
              field_output.append(connection.ops.tablespace_sql(tablespace, inline=True))
          if f.rel:
              if f.rel.to in known_models:
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