# Generated by Django 5.0.6 on 2025-08-18 04:34

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='AnalysisProvider',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=100, unique=True)),
                ('provider_type', models.CharField(max_length=50)),
                ('model_identifier', models.CharField(max_length=200)),
                ('capabilities', models.JSONField(default=list)),
                ('active', models.BooleanField(default=True)),
                ('api_config', models.JSONField(default=dict)),
            ],
        ),
        migrations.CreateModel(
            name='Brand',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=100, unique=True)),
                ('search_terms', models.JSONField(default=list)),
                ('active', models.BooleanField(default=True)),
                ('category', models.CharField(max_length=50, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='ProcessingQueue',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('stream_id', models.CharField(max_length=100)),
                ('segment_path', models.CharField(max_length=500)),
                ('priority', models.IntegerField(default=0)),
                ('status', models.CharField(choices=[('pending', 'Pending'), ('processing', 'Processing'), ('completed', 'Completed'), ('failed', 'Failed')], default='pending', max_length=20)),
                ('analysis_types', models.JSONField(default=list)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('started_at', models.DateTimeField(null=True)),
                ('completed_at', models.DateTimeField(null=True)),
                ('error_message', models.TextField(null=True)),
            ],
            options={
                'indexes': [models.Index(fields=['status', 'priority'], name='ai_processi_status_958bda_idx'), models.Index(fields=['stream_id'], name='ai_processi_stream__60b035_idx')],
            },
        ),
        migrations.CreateModel(
            name='VideoAnalysis',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('stream_id', models.CharField(max_length=100)),
                ('segment_path', models.CharField(max_length=500)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('processing_time', models.FloatField(null=True)),
                ('analysis_type', models.CharField(max_length=50)),
                ('confidence_threshold', models.FloatField(default=0.5)),
                ('frame_timestamp', models.FloatField()),
                ('external_request_id', models.CharField(max_length=200, null=True)),
                ('provider', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ai_processing.analysisprovider')),
            ],
        ),
        migrations.CreateModel(
            name='DetectionResult',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('label', models.CharField(max_length=200)),
                ('confidence', models.FloatField()),
                ('bbox_x', models.FloatField()),
                ('bbox_y', models.FloatField()),
                ('bbox_width', models.FloatField()),
                ('bbox_height', models.FloatField()),
                ('detection_type', models.CharField(max_length=50)),
                ('metadata', models.JSONField(default=dict)),
                ('analysis', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='detections', to='ai_processing.videoanalysis')),
            ],
        ),
        migrations.CreateModel(
            name='VisualAnalysis',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('dominant_colors', models.JSONField(default=list)),
                ('brightness_level', models.FloatField()),
                ('contrast_level', models.FloatField(null=True)),
                ('saturation_level', models.FloatField(null=True)),
                ('activity_score', models.FloatField(null=True)),
                ('scene_description', models.TextField(null=True)),
                ('analysis', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='visual', to='ai_processing.videoanalysis')),
            ],
        ),
        migrations.AddIndex(
            model_name='videoanalysis',
            index=models.Index(fields=['stream_id', 'timestamp'], name='ai_processi_stream__b961da_idx'),
        ),
        migrations.AddIndex(
            model_name='videoanalysis',
            index=models.Index(fields=['analysis_type'], name='ai_processi_analysi_774d33_idx'),
        ),
        migrations.AddIndex(
            model_name='detectionresult',
            index=models.Index(fields=['label'], name='ai_processi_label_20bc74_idx'),
        ),
        migrations.AddIndex(
            model_name='detectionresult',
            index=models.Index(fields=['confidence'], name='ai_processi_confide_123ee5_idx'),
        ),
        migrations.AddIndex(
            model_name='detectionresult',
            index=models.Index(fields=['detection_type'], name='ai_processi_detecti_c390f2_idx'),
        ),
    ]
