from django.db import migrations, models import uuid class Migration(migrations.Migration): dependencies = [ ("core", "0008_ocr_fields"), ] operations = [ migrations.CreateModel( name="IngestionJob", fields=[ ( "id", models.UUIDField( default=uuid.uuid4, editable=False, primary_key=True, serialize=False ), ), ("code", models.CharField(max_length=128)), ("filename", models.CharField(max_length=255)), ("metadata", models.JSONField(blank=True, default=dict)), ("stats", models.JSONField(blank=True, default=dict)), ( "status", models.CharField( choices=[ ("pending", "Pending"), ("running", "Running"), ("completed", "Completed"), ("failed", "Failed"), ], default="pending", max_length=20, ), ), ("error_message", models.TextField(blank=True)), ("storage_path", models.CharField(blank=True, max_length=512)), ("progress", models.PositiveIntegerField(default=0)), ("created_at", models.DateTimeField(auto_now_add=True)), ("updated_at", models.DateTimeField(auto_now=True)), ("started_at", models.DateTimeField(blank=True, null=True)), ("finished_at", models.DateTimeField(blank=True, null=True)), ( "document", models.ForeignKey( blank=True, null=True, on_delete=models.SET_NULL, related_name="ingestion_jobs", to="core.legaldocument", ), ), ], options={ "ordering": ("-created_at",), }, ), ]