Skip to content
Snippets Groups Projects
Commit 2453ffb0 authored by Tom Teichler's avatar Tom Teichler :beers:
Browse files

Do not use settings.INSTALLEDA_APPS in migration

parent 00bdf847
No related branches found
No related tags found
1 merge request!1113Resolve "[3.0] Move Room from Chronos to Core"
Pipeline #103672 passed with warnings
# Generated by Django 3.2.15 on 2022-11-20 14:20
from django.conf import settings
from django.apps import apps
import django.contrib.sites.managers
from django.db import migrations, models
import django.db.models.deletion
......@@ -16,7 +16,7 @@ class Migration(migrations.Migration):
('core', '0045_data_check_result_fix_check_field'),
]
if "aleksis.apps.chronos.apps.ChronosConfig" in settings.INSTALLED_APPS:
if "chronos" in apps.app_configs:
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'))
......@@ -48,7 +48,7 @@ class Migration(migrations.Migration):
# Migrate data from Chronos table; deletion will be handled by Chronos
migrations.RunSQL(
"""
-- Use a temporary, empty source table in case Chronos is not installed
-- Copy rooms from chronos if table exists
DO $$BEGIN INSERT INTO core_room SELECT * FROM chronos_room; EXCEPTION WHEN undefined_table THEN NULL; END$$;
"""
),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment