mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-14 04:38:16 +00:00
working on MariaDB crash on server
This commit is contained in:
@@ -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'])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user