# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-11-02 21:41
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='tvnews_FaceTrack',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
        ),
        migrations.CreateModel(
            name='tvnews_Face',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('bbox_x1', models.FloatField()),
                ('bbox_x2', models.FloatField()),
                ('bbox_y1', models.FloatField()),
                ('bbox_y2', models.FloatField()),
                ('bbox_score', models.FloatField()),
            ],
        ),
        migrations.CreateModel(
            name='tvnews_FaceFeatures',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('features', models.BinaryField()),
                ('face', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_query_name='facefeatures', to='query.tvnews_Face')),
            ],
        ),
        migrations.CreateModel(
            name='tvnews_Frame',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('number', models.IntegerField(db_index=True)),
                ('talking_heads', models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name='tvnews_Gender',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=256)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='tvnews_Identity',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=256)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='tvnews_Labeler',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(db_index=True, max_length=256)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='tvnews_Video',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('path', models.CharField(db_index=True, max_length=256)),
                ('num_frames', models.IntegerField()),
                ('fps', models.FloatField()),
                ('width', models.IntegerField()),
                ('height', models.IntegerField()),
                ('channel', models.CharField(max_length=256)),
                ('show', models.CharField(max_length=256)),
                ('time', models.DateTimeField()),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='tvnews_frame',
            name='video',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_query_name='frame', to='query.tvnews_Video'),
        ),
        migrations.AddField(
            model_name='tvnews_facefeatures',
            name='labeler',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_query_name='facefeatures', to='query.tvnews_Labeler'),
        ),
        migrations.AddField(
            model_name='tvnews_face',
            name='frame',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_query_name='face', to='query.tvnews_Frame'),
        ),
        migrations.AddField(
            model_name='tvnews_face',
            name='gender',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='query.tvnews_Gender'),
        ),
        migrations.AddField(
            model_name='tvnews_face',
            name='identity',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='query.tvnews_Identity'),
        ),
        migrations.AddField(
            model_name='tvnews_face',
            name='labeler',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_query_name='face', to='query.tvnews_Labeler'),
        ),
        migrations.AddField(
            model_name='tvnews_face',
            name='track',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_query_name='face', to='query.tvnews_FaceTrack'),
        ),
        migrations.AddField(
            model_name='tvnews_facetrack',
            name='gender',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='query.tvnews_Gender'),
        ),
        migrations.AddField(
            model_name='tvnews_facetrack',
            name='identity',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='query.tvnews_Identity'),
        ),
        migrations.AlterUniqueTogether(
            name='tvnews_frame',
            unique_together=set([('video', 'number')]),
        ),
        migrations.AlterUniqueTogether(
            name='tvnews_facefeatures',
            unique_together=set([('labeler', 'face')]),
        ),
        migrations.AlterUniqueTogether(
            name='tvnews_face',
            unique_together=set([('track', 'frame', 'labeler')]),
        ),
    ]
