# Generated by Django 5.2.4 on 2025-07-28 10:08 import django.db.models.deletion import uuid from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name="WorkflowRequest", fields=[ ( "id", models.UUIDField( default=uuid.uuid4, editable=False, primary_key=True, serialize=False, ), ), ("agent_slug", models.CharField(db_index=True, max_length=100)), ("input_data", models.JSONField(default=dict)), ( "status", models.CharField( choices=[ ("processing", "Processing"), ("completed", "Completed"), ("failed", "Failed"), ], default="processing", max_length=20, ), ), ("created_at", models.DateTimeField(auto_now_add=True)), ("updated_at", models.DateTimeField(auto_now=True)), ( "user", models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, related_name="workflow_requests", to=settings.AUTH_USER_MODEL, ), ), ], options={ "ordering": ["-created_at"], }, ), migrations.CreateModel( name="WorkflowResponse", fields=[ ( "id", models.BigAutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("output_data", models.JSONField(default=dict)), ( "processing_time", models.DecimalField( blank=True, decimal_places=2, max_digits=5, null=True ), ), ("success", models.BooleanField(default=True)), ("error_message", models.TextField(blank=True)), ("n8n_session_id", models.CharField(blank=True, max_length=100)), ("created_at", models.DateTimeField(auto_now_add=True)), ( "request", models.OneToOneField( on_delete=django.db.models.deletion.CASCADE, related_name="response", to="workflows.workflowrequest", ), ), ], ), migrations.CreateModel( name="WorkflowAnalytics", fields=[ ( "id", models.BigAutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("agent_slug", models.CharField(db_index=True, max_length=100)), ( "processing_time", models.DecimalField(decimal_places=2, max_digits=5), ), ("success", models.BooleanField()), ("date", models.DateField(auto_now_add=True)), ("created_at", models.DateTimeField(auto_now_add=True)), ( "user", models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, ), ), ], options={ "indexes": [ models.Index( fields=["agent_slug", "date"], name="workflows_w_agent_s_feee49_idx", ), models.Index( fields=["user", "date"], name="workflows_w_user_id_94f7cd_idx" ), ], }, ), migrations.AddIndex( model_name="workflowrequest", index=models.Index( fields=["user", "-created_at"], name="workflows_w_user_id_29fa9d_idx" ), ), migrations.AddIndex( model_name="workflowrequest", index=models.Index( fields=["agent_slug", "-created_at"], name="workflows_w_agent_s_c56767_idx", ), ), ]