# Generated by Django 4.0 on 2022-08-04 15:41
from typing import List

from django.conf import settings
from django.db import migrations, models


def two_step_migrations() -> List:
    if settings.AUDITLOG_TWO_STEP_MIGRATION:
        return [
            migrations.RenameField(
                model_name="logentry",
                old_name="changes",
                new_name="changes_text",
            ),
            migrations.AddField(
                model_name="logentry",
                name="changes",
                field=models.JSONField(null=True, verbose_name="change message"),
            ),
        ]

    return [
        migrations.AddField(
            model_name="logentry",
            name="changes_text",
            field=models.TextField(blank=True, verbose_name="text change message"),
        ),
        migrations.AlterField(
            model_name="logentry",
            name="changes",
            field=models.JSONField(null=True, verbose_name="change message"),
        ),
    ]


class Migration(migrations.Migration):
    dependencies = [
        ("auditlog", "0014_logentry_cid"),
    ]

    operations = [*two_step_migrations()]
