forked from expo/troggle
add FLUSH command
This commit is contained in:
parent
9a28e93ac6
commit
3ef5c1aa0b
@ -6,6 +6,8 @@ import sys
|
|||||||
import time
|
import time
|
||||||
|
|
||||||
import settings
|
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.
|
""" Command-line utility for loading cave data files into troggle's database.
|
||||||
|
|
||||||
@ -124,6 +126,12 @@ def reinit_db():
|
|||||||
except:
|
except:
|
||||||
print(f" - - Exception when attempting to: USE {currentdbname}")
|
print(f" - - Exception when attempting to: USE {currentdbname}")
|
||||||
pass
|
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(f" - Nuked : {currentdbname}\n")
|
||||||
|
|
||||||
print(" - Migrating: " + django.db.connections.databases["default"]["NAME"])
|
print(" - Migrating: " + django.db.connections.databases["default"]["NAME"])
|
||||||
|
Loading…
Reference in New Issue
Block a user