# Generated by Django 5.2.14 on 2026-06-06 13:43

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


class Migration(migrations.Migration):

    dependencies = [
        ("corpuses", "0056_corpus_auto_branding_enabled"),
        ("documents", "0041_pendingdocumentannotations"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name="PendingCorpusImport",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("import_run_id", models.UUIDField(db_index=True, unique=True)),
                ("relationships_payload", models.JSONField(blank=True, default=list)),
                ("expected_doc_count", models.IntegerField(blank=True, null=True)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("enumerating", "Enumerating"),
                            ("ready", "Ready"),
                            ("finalizing", "Finalizing"),
                            ("done", "Done"),
                            ("failed", "Failed"),
                        ],
                        db_index=True,
                        default="enumerating",
                        max_length=16,
                    ),
                ),
                ("report", models.JSONField(blank=True, default=dict)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                (
                    "corpus",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="corpuses.corpus",
                    ),
                ),
                (
                    "creator",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "Pending Corpus Import",
                "verbose_name_plural": "Pending Corpus Imports",
                "ordering": ["-created_at"],
            },
        ),
    ]
