summaryrefslogtreecommitdiffstats
path: root/databaseReset.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2023-02-02 00:01:37 +0000
committerPhilip Sargent <philip.sargent@gmail.com>2023-02-02 00:01:37 +0000
commitb55bfb886893d7a9b2c08109b08affa732a9bf33 (patch)
treee26e6632a413be3a5c99b24862c73a667468b32b /databaseReset.py
parent3a348d5d1a8789060eedd756582b565684386076 (diff)
downloadtroggle-b55bfb886893d7a9b2c08109b08affa732a9bf33.tar.gz
troggle-b55bfb886893d7a9b2c08109b08affa732a9bf33.tar.bz2
troggle-b55bfb886893d7a9b2c08109b08affa732a9bf33.zip
more debug
Diffstat (limited to 'databaseReset.py')
-rw-r--r--databaseReset.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/databaseReset.py b/databaseReset.py
index c00f9e1..dcbc5a3 100644
--- a/databaseReset.py
+++ b/databaseReset.py
@@ -103,25 +103,27 @@ def reinit_db():
# 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()
- print(f" - - Using {cursor}\n")
+ print(f" - - Using {cursor}")
try:
cursor.execute(f"DROP DATABASE {currentdbname}")
except:
- print(f" - - Exception when attempting to: DROP DATABASE {currentdbname} with {cursor}\n")
+ print(f" - - Exception when attempting to: DROP DATABASE {currentdbname} with {cursor}")
pass
try:
cursor.execute(f"CREATE DATABASE {currentdbname}")
except:
- print(f" - - Exception when attempting to: CREATE DATABASE {currentdbname} with {cursor}\n")
+ print(f" - - Exception when attempting to: CREATE DATABASE {currentdbname} with {cursor}")
pass
try:
cursor.execute(f"ALTER DATABASE {currentdbname} CHARACTER SET=utf8")
except:
- print(f" - - Exception when attempting to: ALTER DATABASE {currentdbname} CHARACTER SET=utf8}\n")
+ print(f" - - Exception when attempting to: ALTER DATABASE {currentdbname} CHARACTER SET=utf8")
+ pass
+ try:
+ cursor.execute(f"USE {currentdbname}")
+ except:
+ print(f" - - Exception when attempting to: USE {currentdbname}")
pass
-
-
- cursor.execute(f"USE {currentdbname}")
print(f" - Nuked : {currentdbname}\n")
print(" - Migrating: " + django.db.connections.databases["default"]["NAME"])