# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2018-06-07 08:52
from __future__ import unicode_literals

from django.conf import settings
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
import uuid


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='DeletedVideo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('video_uuid', models.UUIDField(default=uuid.uuid4, null=True)),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='date created')),
                ('deleter', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='user_deleter', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='DVAPQL',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('process_type', models.CharField(choices=[(b'S', 'Schedule'), (b'V', 'Process'), (b'Q', 'Query')], default=b'Q', max_length=1)),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='date created')),
                ('script', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
                ('results_metadata', models.TextField(default='')),
                ('results_available', models.BooleanField(default=False)),
                ('completed', models.BooleanField(default=False)),
                ('failed', models.BooleanField(default=False)),
                ('error_message', models.TextField(blank=True, default='', null=True)),
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='submitter', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Export',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('export_type', models.CharField(choices=[(b'M', 'Model export'), (b'V', 'Video export')], db_index=True, max_length=1)),
                ('url', models.TextField(default='')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='date created')),
            ],
        ),
        migrations.CreateModel(
            name='Frame',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('frame_index', models.IntegerField()),
                ('name', models.CharField(max_length=200, null=True)),
                ('subdir', models.TextField(default='')),
                ('h', models.IntegerField(default=0)),
                ('w', models.IntegerField(default=0)),
                ('t', models.FloatField(null=True)),
                ('keyframe', models.BooleanField(default=False)),
                ('segment_index', models.IntegerField(null=True)),
            ],
        ),
        migrations.CreateModel(
            name='IndexEntries',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('features_file_name', models.CharField(max_length=100)),
                ('entries', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
                ('metadata', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
                ('algorithm', models.CharField(max_length=100)),
                ('indexer_shasum', models.CharField(max_length=40)),
                ('approximator_shasum', models.CharField(max_length=40, null=True)),
                ('detection_name', models.CharField(max_length=100)),
                ('count', models.IntegerField()),
                ('approximate', models.BooleanField(default=False)),
                ('contains_frames', models.BooleanField(default=False)),
                ('contains_detections', models.BooleanField(default=False)),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='date created')),
            ],
        ),
        migrations.CreateModel(
            name='ManagementAction',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('parent_task', models.CharField(default='', max_length=500)),
                ('op', models.CharField(default='', max_length=500)),
                ('host', models.CharField(default='', max_length=500)),
                ('message', models.TextField()),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='date created')),
                ('ping_index', models.IntegerField(null=True)),
            ],
        ),
        migrations.CreateModel(
            name='QueryRegion',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('region_type', models.CharField(choices=[(b'A', 'Annotation'), (b'D', 'Detection'), (b'P', 'Polygon'), (b'S', 'Segmentation'), (b'T', 'Transform')], db_index=True, max_length=1)),
                ('text', models.TextField(default='')),
                ('metadata', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
                ('full_frame', models.BooleanField(default=False)),
                ('x', models.IntegerField(default=0)),
                ('y', models.IntegerField(default=0)),
                ('h', models.IntegerField(default=0)),
                ('w', models.IntegerField(default=0)),
                ('polygon_points', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='date created')),
                ('object_name', models.CharField(max_length=100)),
                ('confidence', models.FloatField(default=0.0)),
                ('png', models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name='QueryRegionIndexVector',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('vector', models.BinaryField()),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='date created')),
            ],
        ),
        migrations.CreateModel(
            name='QueryRegionResults',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('rank', models.IntegerField()),
                ('algorithm', models.CharField(max_length=100)),
                ('distance', models.FloatField(default=0.0)),
            ],
        ),
        migrations.CreateModel(
            name='QueryResults',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('rank', models.IntegerField()),
                ('algorithm', models.CharField(max_length=100)),
                ('distance', models.FloatField(default=0.0)),
            ],
        ),
        migrations.CreateModel(
            name='Region',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('region_type', models.CharField(choices=[(b'A', 'Annotation'), (b'D', 'Detection'), (b'P', 'Polygon'), (b'S', 'Segmentation'), (b'T', 'Transform')], db_index=True, max_length=1)),
                ('frame_index', models.IntegerField(default=-1)),
                ('segment_index', models.IntegerField(default=-1, null=True)),
                ('text', models.TextField(default='')),
                ('metadata', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
                ('full_frame', models.BooleanField(default=False)),
                ('x', models.IntegerField(default=0)),
                ('y', models.IntegerField(default=0)),
                ('h', models.IntegerField(default=0)),
                ('w', models.IntegerField(default=0)),
                ('polygon_points', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='date created')),
                ('object_name', models.CharField(max_length=100)),
                ('confidence', models.FloatField(default=0.0)),
                ('materialized', models.BooleanField(default=False)),
                ('png', models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name='RegionRelation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=400)),
                ('weight', models.FloatField(null=True)),
                ('metadata', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Retriever',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('algorithm', models.CharField(choices=[('L', 'LOPQ'), ('E', 'Exact'), ('F', 'FAISS')], db_index=True, default='E', max_length=1)),
                ('name', models.CharField(default='', max_length=200)),
                ('indexer_shasum', models.CharField(max_length=40, null=True)),
                ('approximator_shasum', models.CharField(max_length=40, null=True)),
                ('source_filters', django.contrib.postgres.fields.jsonb.JSONField()),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='date created')),
            ],
        ),
        migrations.CreateModel(
            name='Segment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('segment_index', models.IntegerField()),
                ('start_time', models.FloatField(default=0.0)),
                ('end_time', models.FloatField(default=0.0)),
                ('metadata', models.TextField(default='{}')),
                ('frame_count', models.IntegerField(default=0)),
                ('start_index', models.IntegerField(default=0)),
                ('framelist', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
                ('end_frame', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='segment_end', to='dvaapp.Frame')),
            ],
        ),
        migrations.CreateModel(
            name='SystemState',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='date created')),
                ('process_stats', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
                ('worker_stats', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
                ('redis_stats', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
                ('queues', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
                ('hosts', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='TaskRestart',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('original_event_pk', models.IntegerField()),
                ('launched_event_pk', models.IntegerField()),
                ('attempts', models.IntegerField(default=0)),
                ('arguments', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
                ('operation', models.CharField(default='', max_length=100)),
                ('queue', models.CharField(default='', max_length=100)),
                ('video_uuid', models.UUIDField(default=uuid.uuid4, null=True)),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='date created')),
                ('process', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dvaapp.DVAPQL')),
            ],
        ),
        migrations.CreateModel(
            name='TEvent',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('started', models.BooleanField(default=False)),
                ('completed', models.BooleanField(default=False)),
                ('errored', models.BooleanField(default=False)),
                ('error_message', models.TextField(default='')),
                ('operation', models.CharField(default='', max_length=100)),
                ('queue', models.CharField(default='', max_length=100)),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='date created')),
                ('start_ts', models.DateTimeField(null=True, verbose_name='date started')),
                ('duration', models.FloatField(default=-1)),
                ('arguments', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
                ('task_id', models.TextField(null=True)),
                ('imported', models.BooleanField(default=False)),
                ('task_group_id', models.IntegerField(default=-1)),
                ('parent', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='dvaapp.TEvent')),
                ('parent_process', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='dvaapp.DVAPQL')),
            ],
        ),
        migrations.CreateModel(
            name='TrainedModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('detector_type', models.CharField(choices=[(b'T', 'Tensorflow'), (b'Y', 'YOLO V2')], db_index=True, max_length=1, null=True)),
                ('mode', models.CharField(choices=[(b'T', 'Tensorflow'), (b'C', 'Caffe'), (b'P', 'Pytorch'), (b'O', 'OpenCV'), (b'M', 'MXNet')], db_index=True, default=b'T', max_length=1)),
                ('model_type', models.CharField(choices=[(b'P', 'Approximator'), (b'I', 'Indexer'), (b'D', 'Detector'), (b'A', 'Analyzer'), (b'S', 'Segmenter')], db_index=True, default=b'I', max_length=1)),
                ('name', models.CharField(max_length=100)),
                ('algorithm', models.CharField(default='', max_length=100)),
                ('shasum', models.CharField(max_length=40, null=True, unique=True)),
                ('model_filename', models.CharField(default='', max_length=200, null=True)),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='date created')),
                ('arguments', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
                ('trained', models.BooleanField(default=False)),
                ('url', models.CharField(default='', max_length=200)),
                ('files', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
                ('produces_labels', models.BooleanField(default=False)),
                ('produces_json', models.BooleanField(default=False)),
                ('produces_text', models.BooleanField(default=False)),
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
                ('event', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dvaapp.TEvent')),
                ('parent', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='dvaapp.TrainedModel')),
            ],
        ),
        migrations.CreateModel(
            name='TrainingSet',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
                ('source_filters', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
                ('training_task_type', models.CharField(choices=[(b'D', 'Detection'), (b'I', 'Indexing'), (b'A', 'Approximation'), (b'C', 'Classification')], db_index=True, default=b'D', max_length=1)),
                ('instance_type', models.CharField(choices=[(b'I', 'images'), (b'X', 'index'), (b'V', 'videos')], db_index=True, default=b'I', max_length=1)),
                ('count', models.IntegerField(null=True)),
                ('name', models.CharField(default='', max_length=500)),
                ('files', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
                ('built', models.BooleanField(default=False)),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='date created')),
                ('event', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dvaapp.TEvent')),
            ],
        ),
        migrations.CreateModel(
            name='Tube',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('frame_level', models.BooleanField(default=False)),
                ('full_video', models.BooleanField(default=False)),
                ('full_segment', models.BooleanField(default=False)),
                ('start_frame_index', models.IntegerField()),
                ('end_frame_index', models.IntegerField()),
                ('text', models.TextField(default='')),
                ('metadata', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
                ('end_frame', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='end_frame', to='dvaapp.Frame')),
                ('end_region', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='end_region', to='dvaapp.Region')),
                ('event', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dvaapp.TEvent')),
                ('start_frame', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='start_frame', to='dvaapp.Frame')),
                ('start_region', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='start_region', to='dvaapp.Region')),
            ],
        ),
        migrations.CreateModel(
            name='TubeRegionRelation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=400)),
                ('weight', models.FloatField(null=True)),
                ('metadata', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
                ('event', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dvaapp.TEvent')),
                ('region', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dvaapp.Region')),
                ('tube', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dvaapp.Tube')),
            ],
        ),
        migrations.CreateModel(
            name='TubeRelation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=400)),
                ('weight', models.FloatField(null=True)),
                ('metadata', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
                ('event', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dvaapp.TEvent')),
                ('source_tube', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='source_tube', to='dvaapp.Tube')),
                ('target_tube', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='target_tube', to='dvaapp.Tube')),
            ],
        ),
        migrations.CreateModel(
            name='Video',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('name', models.CharField(default='', max_length=500)),
                ('length_in_seconds', models.IntegerField(default=0)),
                ('height', models.IntegerField(default=0)),
                ('width', models.IntegerField(default=0)),
                ('metadata', models.TextField(default='')),
                ('frames', models.IntegerField(default=0)),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='date created')),
                ('description', models.TextField(default='')),
                ('uploaded', models.BooleanField(default=False)),
                ('dataset', models.BooleanField(default=False)),
                ('segments', models.IntegerField(default=0)),
                ('stream', models.BooleanField(default=False)),
                ('url', models.TextField(default='')),
                ('parent_process', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='dvaapp.DVAPQL')),
                ('uploader', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Worker',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('queue_name', models.CharField(default='', max_length=500)),
                ('host', models.CharField(default='', max_length=500)),
                ('pid', models.IntegerField()),
                ('alive', models.BooleanField(default=True)),
                ('last_ping', models.DateTimeField(null=True, verbose_name='date last ping')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='date created')),
            ],
        ),
        migrations.AddField(
            model_name='tuberelation',
            name='video',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dvaapp.Video'),
        ),
        migrations.AddField(
            model_name='tuberegionrelation',
            name='video',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dvaapp.Video'),
        ),
        migrations.AddField(
            model_name='tube',
            name='video',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='dvaapp.Video'),
        ),
        migrations.AddField(
            model_name='trainedmodel',
            name='training_set',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='dvaapp.TrainingSet'),
        ),
        migrations.AddField(
            model_name='tevent',
            name='video',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='dvaapp.Video'),
        ),
        migrations.AddField(
            model_name='tevent',
            name='worker',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='dvaapp.Worker'),
        ),
        migrations.AddField(
            model_name='segment',
            name='event',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dvaapp.TEvent'),
        ),
        migrations.AddField(
            model_name='segment',
            name='start_frame',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='segment_start', to='dvaapp.Frame'),
        ),
        migrations.AddField(
            model_name='segment',
            name='video',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dvaapp.Video'),
        ),
        migrations.AddField(
            model_name='regionrelation',
            name='event',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dvaapp.TEvent'),
        ),
        migrations.AddField(
            model_name='regionrelation',
            name='source_region',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='source_region', to='dvaapp.Region'),
        ),
        migrations.AddField(
            model_name='regionrelation',
            name='target_region',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='target_region', to='dvaapp.Region'),
        ),
        migrations.AddField(
            model_name='regionrelation',
            name='video',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dvaapp.Video'),
        ),
        migrations.AddField(
            model_name='region',
            name='event',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dvaapp.TEvent'),
        ),
        migrations.AddField(
            model_name='region',
            name='frame',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='dvaapp.Frame'),
        ),
        migrations.AddField(
            model_name='region',
            name='user',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='region',
            name='video',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dvaapp.Video'),
        ),
        migrations.AddField(
            model_name='queryresults',
            name='detection',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='dvaapp.Region'),
        ),
        migrations.AddField(
            model_name='queryresults',
            name='frame',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dvaapp.Frame'),
        ),
        migrations.AddField(
            model_name='queryresults',
            name='query',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dvaapp.DVAPQL'),
        ),
        migrations.AddField(
            model_name='queryresults',
            name='retrieval_event',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dvaapp.TEvent'),
        ),
        migrations.AddField(
            model_name='queryresults',
            name='video',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dvaapp.Video'),
        ),
        migrations.AddField(
            model_name='queryregionresults',
            name='detection',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='dvaapp.Region'),
        ),
        migrations.AddField(
            model_name='queryregionresults',
            name='frame',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dvaapp.Frame'),
        ),
        migrations.AddField(
            model_name='queryregionresults',
            name='query',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dvaapp.DVAPQL'),
        ),
        migrations.AddField(
            model_name='queryregionresults',
            name='query_region',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dvaapp.QueryRegion'),
        ),
        migrations.AddField(
            model_name='queryregionresults',
            name='retrieval_event',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dvaapp.TEvent'),
        ),
        migrations.AddField(
            model_name='queryregionresults',
            name='video',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dvaapp.Video'),
        ),
        migrations.AddField(
            model_name='queryregionindexvector',
            name='event',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dvaapp.TEvent'),
        ),
        migrations.AddField(
            model_name='queryregionindexvector',
            name='query_region',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dvaapp.QueryRegion'),
        ),
        migrations.AddField(
            model_name='queryregion',
            name='event',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dvaapp.TEvent'),
        ),
        migrations.AddField(
            model_name='queryregion',
            name='query',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dvaapp.DVAPQL'),
        ),
        migrations.AddField(
            model_name='indexentries',
            name='event',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dvaapp.TEvent'),
        ),
        migrations.AddField(
            model_name='indexentries',
            name='indexer',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='dvaapp.TrainedModel'),
        ),
        migrations.AddField(
            model_name='indexentries',
            name='video',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dvaapp.Video'),
        ),
        migrations.AddField(
            model_name='frame',
            name='event',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dvaapp.TEvent'),
        ),
        migrations.AddField(
            model_name='frame',
            name='video',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dvaapp.Video'),
        ),
        migrations.AddField(
            model_name='export',
            name='event',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dvaapp.TEvent'),
        ),
        migrations.AlterUniqueTogether(
            name='segment',
            unique_together=set([('video', 'segment_index')]),
        ),
        migrations.AlterUniqueTogether(
            name='frame',
            unique_together=set([('video', 'frame_index')]),
        ),
    ]
