# Generated by Django 5.1.2 on 2024-11-01 18:44

import django.db.models.deletion
from django.db import migrations, models

import arches_modular_reports.utils
from arches.app.models.system_settings import settings


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("models", "11499_add_editlog_resourceinstance_idx"),
    ]

    operations = [
        migrations.CreateModel(
            name="ReportConfig",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "config",
                    models.JSONField(
                        blank=True,
                        default=dict,
                        encoder=arches_modular_reports.utils.PrettyJSONEncoder,
                    ),
                ),
                (
                    "graph",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="report",
                        to="models.graphmodel",
                        limit_choices_to=models.Q(isresource=True)
                        & ~models.Q(pk=settings.SYSTEM_SETTINGS_RESOURCE_MODEL_ID),
                    ),
                ),
            ],
            options={
                "db_table": "arches_modular_report_config",
                "managed": True,
            },
        ),
    ]
