2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-25 00:31:55 +00:00

differences between sqlite and MariaDB

This commit is contained in:
Philip Sargent 2020-07-22 23:51:50 +01:00
parent a6ed0997e8
commit c65544a377

View File

@ -93,13 +93,21 @@ def reinit_db():
print(" - Migrating: " + django.db.connections.databases['default']['NAME'])
with transaction.atomic():
if django.db.connections.databases['default']['ENGINE'] == 'django.db.backends.sqlite3':
with transaction.atomic():
management.call_command('makemigrations','core', interactive=False)
management.call_command('makemigrations','flatpages', interactive=False)
management.call_command('migrate', interactive=False)
management.call_command('migrate','core', interactive=False)
management.call_command('migrate','flatpages', interactive=False)
else:
management.call_command('makemigrations','core', interactive=False)
management.call_command('makemigrations','flatpages', interactive=False)
management.call_command('migrate', interactive=False)
management.call_command('migrate','core', interactive=False)
management.call_command('migrate','flatpages', interactive=False)
print(" - done migration on: " + settings.DATABASES['default']['NAME'])
print("users in db already: ",len(User.objects.all()))
with transaction.atomic():