# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-01-17 07:57
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='Dataset',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('bucket', models.CharField(max_length=100)),
                ('key', models.CharField(max_length=100)),
                ('metadata', models.TextField(default='')),
                ('frames', models.IntegerField()),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='date created')),
                ('description', models.TextField()),
            ],
        ),
        migrations.CreateModel(
            name='Detection',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('object_name', models.CharField(max_length=100)),
                ('confidence', models.FloatField(default=0.0)),
                ('x', models.IntegerField(default=0)),
                ('y', models.IntegerField(default=0)),
                ('h', models.IntegerField(default=0)),
                ('w', models.IntegerField(default=0)),
                ('dataset', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='dvaapp.Dataset')),
            ],
        ),
        migrations.CreateModel(
            name='Frame',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('time_seconds', models.IntegerField()),
                ('key', models.CharField(max_length=200)),
                ('bucket', models.CharField(max_length=200)),
                ('dataset', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='dvaapp.Dataset')),
            ],
        ),
        migrations.CreateModel(
            name='IndexEntry',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('algorithm', models.CharField(max_length=100)),
                ('d', models.IntegerField(default=0)),
                ('x', models.IntegerField(default=0)),
                ('y', models.IntegerField(default=0)),
                ('h', models.IntegerField(default=0)),
                ('w', models.IntegerField(default=0)),
                ('array_index', models.IntegerField()),
                ('dataset', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='dvaapp.Dataset')),
                ('detection', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='dvaapp.Detection')),
                ('frame', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dvaapp.Frame')),
            ],
        ),
        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)),
                ('recorded', models.DateTimeField(auto_now_add=True, verbose_name='date created')),
                ('dataset', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='dvaapp.Dataset')),
                ('frame', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='dvaapp.Frame')),
            ],
        ),
        migrations.CreateModel(
            name='Video',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('bucket', models.CharField(default='', max_length=100)),
                ('key', models.CharField(default='', max_length=100)),
                ('name', models.CharField(default='', max_length=100)),
                ('length_in_seconds', models.IntegerField()),
                ('height', models.IntegerField(default=0)),
                ('width', models.IntegerField(default=0)),
                ('metadata', models.TextField(default='')),
                ('frames', models.IntegerField()),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='date created')),
                ('description', models.TextField()),
            ],
        ),
        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='indexentry',
            name='video',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='dvaapp.Video'),
        ),
        migrations.AddField(
            model_name='frame',
            name='video',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='dvaapp.Video'),
        ),
        migrations.AddField(
            model_name='detection',
            name='frame',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dvaapp.Frame'),
        ),
        migrations.AddField(
            model_name='detection',
            name='video',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='dvaapp.Video'),
        ),
    ]
