mirror of
https://github.com/django/django.git
synced 2025-10-27 23:56:08 +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:
@@ -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) + ' ' + \
|
||||
|
||||
Reference in New Issue
Block a user