1
0
mirror of https://github.com/django/django.git synced 2025-07-04 01:39:20 +00:00

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
This commit is contained in:
Boulder Sprinters 2007-04-03 21:59:56 +00:00
parent a3053273c8
commit 5bcf13b607
7 changed files with 7 additions and 1 deletions

View File

@ -482,7 +482,7 @@ def get_sql_indexes_for_model(model):
output = [] output = []
for f in model._meta.fields: 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 '' unique = f.unique and 'UNIQUE ' or ''
output.append( output.append(
style.SQL_KEYWORD('CREATE %sINDEX' % unique) + ' ' + \ style.SQL_KEYWORD('CREATE %sINDEX' % unique) + ' ' + \

View File

@ -90,6 +90,7 @@ class DatabaseWrapper(local):
allows_group_by_ordinal = True allows_group_by_ordinal = True
allows_unique_and_pk = True allows_unique_and_pk = True
autoindexes_primary_keys = False
needs_datetime_string_cast = True needs_datetime_string_cast = True
needs_upper_for_iops = False needs_upper_for_iops = False
supports_constraints = True supports_constraints = True

View File

@ -133,6 +133,7 @@ class DatabaseWrapper(local):
allows_group_by_ordinal = True allows_group_by_ordinal = True
allows_unique_and_pk = True allows_unique_and_pk = True
autoindexes_primary_keys = False
needs_datetime_string_cast = True # MySQLdb requires a typecast for dates needs_datetime_string_cast = True # MySQLdb requires a typecast for dates
needs_upper_for_iops = False needs_upper_for_iops = False
supports_constraints = True supports_constraints = True

View File

@ -68,6 +68,7 @@ class DatabaseWrapper(local):
allows_group_by_ordinal = False allows_group_by_ordinal = False
allows_unique_and_pk = False # Suppress UNIQUE/PK for Oracle (ORA-02259) allows_unique_and_pk = False # Suppress UNIQUE/PK for Oracle (ORA-02259)
autoindexes_primary_keys = True
needs_datetime_string_cast = False needs_datetime_string_cast = False
needs_upper_for_iops = True needs_upper_for_iops = True
supports_constraints = True supports_constraints = True

View File

@ -106,6 +106,7 @@ class DatabaseWrapper(local):
allows_group_by_ordinal = True allows_group_by_ordinal = True
allows_unique_and_pk = True allows_unique_and_pk = True
autoindexes_primary_keys = False
needs_datetime_string_cast = True needs_datetime_string_cast = True
needs_upper_for_iops = False needs_upper_for_iops = False
supports_constraints = True supports_constraints = True

View File

@ -74,6 +74,7 @@ class DatabaseWrapper(local):
allows_group_by_ordinal = True allows_group_by_ordinal = True
allows_unique_and_pk = True allows_unique_and_pk = True
autoindexes_primary_keys = False
needs_datetime_string_cast = False needs_datetime_string_cast = False
needs_upper_for_iops = False needs_upper_for_iops = False
supports_constraints = True supports_constraints = True

View File

@ -101,6 +101,7 @@ class SQLiteCursorWrapper(Database.Cursor):
allows_group_by_ordinal = True allows_group_by_ordinal = True
allows_unique_and_pk = True allows_unique_and_pk = True
autoindexes_primary_keys = False
needs_datetime_string_cast = True needs_datetime_string_cast = True
needs_upper_for_iops = False needs_upper_for_iops = False
supports_constraints = False supports_constraints = False