      from django.db.backends.util import truncate_name
  
      qn = connection.ops.quote_name
      final_output = []
      if backend.supports_constraints:
          opts = model._meta
          if model in pending_references:
              for rel_class, f in pending_references[model]:
                  rel_opts = rel_class._meta
                  r_table = rel_opts.db_table
 
</s> remove             if backend.supports_constraints and model in references_to_delete:
 </s> add             if connection.features.supports_constraints and model in references_to_delete: </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 and backend.autoindexes_primary_keys:
 </s> add             if tablespace and connection.features.supports_tablespaces and connection.features.autoindexes_primary_keys: </s> remove     if backend.uses_case_insensitive_names:
 </s> add     if connection.features.uses_case_insensitive_names: </s> remove     from django.db import backend, models
 </s> add     from django.db import connection, models
    if connection.features.supports_constraints:
      from django.db.backends.util import truncate_name
  
      qn = connection.ops.quote_name
      final_output = []
    if connection.features.supports_constraints:
          opts = model._meta
          if model in pending_references:
              for rel_class, f in pending_references[model]:
                  rel_opts = rel_class._meta
                  r_table = rel_opts.db_table
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