2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-25 08:41:51 +00:00

add FLUSH command

This commit is contained in:
Philip Sargent 2023-03-28 19:51:20 +01:00
parent 9a28e93ac6
commit 3ef5c1aa0b

View File

@ -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"])