diff --git a/databaseReset.py b/databaseReset.py index dcbc5a3..1be77c9 100644 --- a/databaseReset.py +++ b/databaseReset.py @@ -6,6 +6,8 @@ import sys import time import settings +from django.core.management import call_command +from django.core.management.commands import flush """ Command-line utility for loading cave data files into troggle's database. @@ -124,6 +126,12 @@ def reinit_db(): except: print(f" - - Exception when attempting to: USE {currentdbname}") pass + try: + cmd = flush.Command() + call_command(cmd, verbosity=0, interactive=False) + except: + print(f" - - Exception when attempting to: FLUSH") + pass print(f" - Nuked : {currentdbname}\n") print(" - Migrating: " + django.db.connections.databases["default"]["NAME"])