Skip to content

Commit

Permalink
Use settings.DEFAULT_TABLESPACE for PostGreSQL tablespace instead of …
Browse files Browse the repository at this point in the history
…default
  • Loading branch information
trbs authored and sqrbass committed Nov 18, 2009
1 parent 1edd5d5 commit 5d9e268
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions django_extensions/management/commands/reset_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ def handle(self, *args, **options):

engine = settings.DATABASE_ENGINE
user = options.get('user', settings.DATABASE_USER)
if user==None:
user = settings.DATABASE_USER
password = options.get('password', settings.DATABASE_PASSWORD)
if password==None:
password = settings.DATABASE_PASSWORD

if engine == 'sqlite3':
import os
Expand Down Expand Up @@ -119,8 +123,8 @@ def handle(self, *args, **options):
CREATE DATABASE %s
WITH OWNER = %s
ENCODING = 'UTF8'
TABLESPACE = pg_default;
""" % (settings.DATABASE_NAME, settings.DATABASE_USER))
TABLESPACE = %s;
""" % (settings.DATABASE_NAME, settings.DATABASE_USER, settings.DEFAULT_TABLESPACE))
logging.info('Executing... "' + create_query + '"')
cursor.execute(create_query)

Expand Down

0 comments on commit 5d9e268

Please sign in to comment.