Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

boulder-oracle-sprint: Fixed #3743 by not creating another index when

the column is a PK and the backend is Oracle.


git-svn-id: http://code.djangoproject.com/svn/django/branches/boulder-oracle-sprint@4916 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 5bcf13b607ea92c34d13cbb52f70c1e6b76ce5cd 1 parent a305327
Boulder Sprinters authored
2  django/core/management.py
View
@@ -482,7 +482,7 @@ def get_sql_indexes_for_model(model):
output = []
for f in model._meta.fields:
- if f.db_index:
+ if f.db_index and not (f.primary_key and backend.autoindexes_primary_keys):
unique = f.unique and 'UNIQUE ' or ''
output.append(
style.SQL_KEYWORD('CREATE %sINDEX' % unique) + ' ' + \
1  django/db/backends/ado_mssql/base.py
View
@@ -90,6 +90,7 @@ def close(self):
allows_group_by_ordinal = True
allows_unique_and_pk = True
+autoindexes_primary_keys = False
needs_datetime_string_cast = True
needs_upper_for_iops = False
supports_constraints = True
1  django/db/backends/mysql/base.py
View
@@ -133,6 +133,7 @@ def get_server_version(self):
allows_group_by_ordinal = True
allows_unique_and_pk = True
+autoindexes_primary_keys = False
needs_datetime_string_cast = True # MySQLdb requires a typecast for dates
needs_upper_for_iops = False
supports_constraints = True
1  django/db/backends/oracle/base.py
View
@@ -68,6 +68,7 @@ def close(self):
allows_group_by_ordinal = False
allows_unique_and_pk = False # Suppress UNIQUE/PK for Oracle (ORA-02259)
+autoindexes_primary_keys = True
needs_datetime_string_cast = False
needs_upper_for_iops = True
supports_constraints = True
1  django/db/backends/postgresql/base.py
View
@@ -106,6 +106,7 @@ def close(self):
allows_group_by_ordinal = True
allows_unique_and_pk = True
+autoindexes_primary_keys = False
needs_datetime_string_cast = True
needs_upper_for_iops = False
supports_constraints = True
1  django/db/backends/postgresql_psycopg2/base.py
View
@@ -74,6 +74,7 @@ def close(self):
allows_group_by_ordinal = True
allows_unique_and_pk = True
+autoindexes_primary_keys = False
needs_datetime_string_cast = False
needs_upper_for_iops = False
supports_constraints = True
1  django/db/backends/sqlite3/base.py
View
@@ -101,6 +101,7 @@ def convert_query(self, query, num_params):
allows_group_by_ordinal = True
allows_unique_and_pk = True
+autoindexes_primary_keys = False
needs_datetime_string_cast = True
needs_upper_for_iops = False
supports_constraints = False
Please sign in to comment.
Something went wrong with that request. Please try again.