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

Merge branch '711-3-0-move-room-from-chronos-to-core' of...

Merge branch '711-3-0-move-room-from-chronos-to-core' of edugit.org:AlekSIS/official/AlekSIS-Core into 711-3-0-move-room-from-chronos-to-core
parents 041dcb99 2453ffb0
No related branches found
No related tags found
1 merge request!1113Resolve "[3.0] Move Room from Chronos to Core"
Pipeline #103677 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,9 +16,9 @@ class Migration(migrations.Migration):
('core', '0045_data_check_result_fix_check_field'),
]
if "aleksis.apps.chronos.apps.ChronosConfig" in settings.INSTALLED_APPS:
Migration = migrations.recorder.MigrationRecorder.Migration
if not Migration.objects.filter(app="core", name="0046_add_room_model").exists():
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'))
operations = [
......@@ -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