# Generated by Django 3.2.25 on 2024-03-28 12:23

from django.db import migrations


class Migration(migrations.Migration):
    dependencies = [
        ("NEMO", "0069_version_5_5_0"),
    ]

    def migrate_calendar_axis_time_format(apps, schema_editor):
        Customization = apps.get_model("NEMO", "Customization")
        calendar_time_format = Customization.objects.filter(name="calendar_time_format").first()
        if calendar_time_format:
            calendar_time_format.name = "calendar_axis_time_format"
            calendar_time_format.save()
            Customization.objects.filter(name="calendar_time_format").delete()

    def reverse_calendar_axis_time_format(apps, schema_editor):
        Customization = apps.get_model("NEMO", "Customization")
        calendar_axis_time_format = Customization.objects.filter(name="calendar_axis_time_format").first()
        if calendar_axis_time_format:
            calendar_axis_time_format.name = "calendar_time_format"
            calendar_axis_time_format.save()
            Customization.objects.filter(name="calendar_axis_time_format").delete()

    operations = [
        migrations.RunPython(migrate_calendar_axis_time_format, reverse_calendar_axis_time_format),
    ]
