Skip to content

Commit

Permalink
Bugfix: Escaped database name for MySQL.
Browse files Browse the repository at this point in the history
  • Loading branch information
alfredo committed Jul 5, 2012
1 parent 4d25457 commit 611f357
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions django_extensions/management/commands/reset_db.py
Expand Up @@ -113,9 +113,9 @@ def handle(self, *args, **options):
kwargs['port'] = int(settings.DATABASE_PORT)

connection = Database.connect(**kwargs)
drop_query = 'DROP DATABASE IF EXISTS %s' % settings.DATABASE_NAME
drop_query = 'DROP DATABASE IF EXISTS `%s`' % settings.DATABASE_NAME
utf8_support = options.get('no_utf8_support', False) and '' or 'CHARACTER SET utf8'
create_query = 'CREATE DATABASE %s %s' % (settings.DATABASE_NAME, utf8_support)
create_query = 'CREATE DATABASE `%s` %s' % (settings.DATABASE_NAME, utf8_support)
logging.info('Executing... "' + drop_query + '"')
connection.query(drop_query)
logging.info('Executing... "' + create_query + '"')
Expand Down

0 comments on commit 611f357

Please sign in to comment.