summaryrefslogtreecommitdiffstats
path: root/databaseReset.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@klebos.com>2022-07-21 21:01:57 +0300
committerPhilip Sargent <philip.sargent@klebos.com>2022-07-21 21:01:57 +0300
commitce7dfd65101bb412345c7e287655fdc434cd4623 (patch)
tree7e5aa478d24902c8028367bc91e644aa61f78d86 /databaseReset.py
parent312ecdcfe15848e612bb782b66f3ff31b349c4e1 (diff)
downloadtroggle-ce7dfd65101bb412345c7e287655fdc434cd4623.tar.gz
troggle-ce7dfd65101bb412345c7e287655fdc434cd4623.tar.bz2
troggle-ce7dfd65101bb412345c7e287655fdc434cd4623.zip
working on MariaDB crash on server
Diffstat (limited to 'databaseReset.py')
-rw-r--r--databaseReset.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/databaseReset.py b/databaseReset.py
index 1d8427b..ae1ea55 100644
--- a/databaseReset.py
+++ b/databaseReset.py
@@ -89,11 +89,15 @@ def reinit_db():
else:
print(" - No database file found: " + currentdbname + " ..continuing, will create it.\n")
else:
+ print(f" - Attempting to nuke : {currentdbname}\n")
+ # this is now completely failing to nuke MariaDB adequately, and it crashes when creating Area objects with a no null parent message
+ # when null parents are explciitly allowed in the model.
cursor = django.db.connection.cursor()
cursor.execute("DROP DATABASE %s" % currentdbname)
cursor.execute("CREATE DATABASE %s" % currentdbname)
cursor.execute("ALTER DATABASE %s CHARACTER SET=utf8" % currentdbname)
cursor.execute("USE %s" % currentdbname)
+ print(f" - Nuked : {currentdbname}\n")
print(" - Migrating: " + django.db.connections.databases['default']['NAME'])