From 00bdf8476d2b9db31f8bf31d78417e2e13c227dc Mon Sep 17 00:00:00 2001
From: Tom Teichler <tom.teichler@teckids.org>
Date: Sat, 17 Dec 2022 13:27:30 +0000
Subject: [PATCH] Only depend on chronos if migration was already applied

---
 aleksis/core/migrations/0046_add_room_model.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/aleksis/core/migrations/0046_add_room_model.py b/aleksis/core/migrations/0046_add_room_model.py
index ad1c70ca3..22cc08004 100644
--- a/aleksis/core/migrations/0046_add_room_model.py
+++ b/aleksis/core/migrations/0046_add_room_model.py
@@ -17,7 +17,9 @@ class Migration(migrations.Migration):
     ]
 
     if "aleksis.apps.chronos.apps.ChronosConfig" in settings.INSTALLED_APPS:
-        dependencies.append(('chronos', '0012_add_supervision_global_permission'))
+        recorder = migrations.recorder
+        if not recorder.MigrationRecorder.Migration.objects.filter(app="core", name="0046_add_room_model").exists():
+            dependencies.append(('chronos', '0012_add_supervision_global_permission'))
 
     operations = [
         migrations.CreateModel(
-- 
GitLab