summaryrefslogtreecommitdiff
path: root/django/core/management/commands/sqlindexes.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/core/management/commands/sqlindexes.py')
-rw-r--r--django/core/management/commands/sqlindexes.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/core/management/commands/sqlindexes.py b/django/core/management/commands/sqlindexes.py
index 66de8c3e7a..c889f03382 100644
--- a/django/core/management/commands/sqlindexes.py
+++ b/django/core/management/commands/sqlindexes.py
@@ -17,4 +17,4 @@ class Command(AppCommand):
output_transaction = True
def handle_app(self, app, **options):
- return u'\n'.join(sql_indexes(app, self.style, connections[options['database']])).encode('utf-8')
+ return u'\n'.join(sql_indexes(app, self.style, connections[options.get('database', DEFAULT_DB_ALIAS)])).encode('utf-8')