From 7a896073e4f0f3637c96837fceb384041a6f2bf8 Mon Sep 17 00:00:00 2001 From: Jenny Danzmayr Date: Wed, 31 Oct 2018 21:34:06 +0100 Subject: [PATCH] fixed migrations to work around transaction limitations of SQLite --- src/c3nav/mapdata/migrations/0012_rename_section_to_level.py | 4 ++++ src/c3nav/mapdata/migrations/0017_point_to_poi.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/c3nav/mapdata/migrations/0012_rename_section_to_level.py b/src/c3nav/mapdata/migrations/0012_rename_section_to_level.py index 58e197ef..f5efd75b 100644 --- a/src/c3nav/mapdata/migrations/0012_rename_section_to_level.py +++ b/src/c3nav/mapdata/migrations/0012_rename_section_to_level.py @@ -2,6 +2,7 @@ # Generated by Django 1.11.2 on 2017-06-11 12:06 from __future__ import unicode_literals +from django.conf import settings from django.db import migrations, models import django.db.models.deletion @@ -79,3 +80,6 @@ class Migration(migrations.Migration): to='mapdata.Level', verbose_name='level'), ), ] + + # workaround as transactions are not supported on SQLite because they would break referential integrity + atomic = settings.DATABASES['default']['ENGINE'] != 'django.db.backends.sqlite3' diff --git a/src/c3nav/mapdata/migrations/0017_point_to_poi.py b/src/c3nav/mapdata/migrations/0017_point_to_poi.py index 4dd00100..cb4fe006 100644 --- a/src/c3nav/mapdata/migrations/0017_point_to_poi.py +++ b/src/c3nav/mapdata/migrations/0017_point_to_poi.py @@ -2,6 +2,7 @@ # Generated by Django 1.11.2 on 2017-07-08 14:23 from __future__ import unicode_literals +from django.conf import settings from django.db import migrations, models import django.db.models.deletion @@ -41,3 +42,6 @@ class Migration(migrations.Migration): to='mapdata.Space', verbose_name='space'), ), ] + + # workaround as transactions are not supported on SQLite because they would break referential integrity + atomic = settings.DATABASES['default']['ENGINE'] != 'django.db.backends.sqlite3'