Fixed #3822 -- Changed get_indexes_for_model() in django.core.management to quote index names. Thanks, Robin Breathe

git-svn-id: http://code.djangoproject.com/svn/django/trunk@4835 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2007-03-27 22:35:22 +00:00
parent e2937ef6a0
commit 302d183a2f
1 changed files with 26 additions and 26 deletions

View File

@ -456,7 +456,7 @@ def get_sql_indexes_for_model(model):
unique = f.unique and 'UNIQUE ' or ''
output.append(
style.SQL_KEYWORD('CREATE %sINDEX' % unique) + ' ' + \
style.SQL_TABLE('%s_%s' % (model._meta.db_table, f.column)) + ' ' + \
style.SQL_TABLE(backend.quote_name('%s_%s' % (model._meta.db_table, f.column))) + ' ' + \
style.SQL_KEYWORD('ON') + ' ' + \
style.SQL_TABLE(backend.quote_name(model._meta.db_table)) + ' ' + \
"(%s);" % style.SQL_FIELD(backend.quote_name(f.column))