2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-22 07:11:52 +00:00

No speedup for database init.

This commit is contained in:
Philip Sargent 2020-07-22 23:44:25 +01:00
parent 721341604c
commit a6ed0997e8

View File

@ -85,12 +85,11 @@ def reinit_db():
else:
print(" - No database file found: " + currentdbname + " ..continuing, will create it.\n")
else:
with transaction.atomic():
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)
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(" - Migrating: " + django.db.connections.databases['default']['NAME'])