# -*- coding: utf-8 -*-
# Generated by Django 1.9.3 on 2016-04-20 16:20
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion
import easy_thumbnails.fields
import functools
import timelapse_manager.storage
import uuid


class Migration(migrations.Migration):

    dependencies = [
        ('timelapse_manager', '0002_auto_20160404_1615'),
    ]

    operations = [
        migrations.CreateModel(
            name='Movie',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('_created_at', models.DateTimeField(auto_now_add=True)),
                ('_updated_at', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=255, unique=True)),
                ('description', models.TextField(blank=True, default=None)),
                ('speed_factor', models.FloatField(default=4000.0)),
                ('camera', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='movies', to='timelapse_manager.Camera')),
            ],
            options={
                'ordering': ('name',),
            },
        ),
        migrations.CreateModel(
            name='MovieRendering',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('_created_at', models.DateTimeField(auto_now_add=True)),
                ('_updated_at', models.DateTimeField(auto_now=True)),
                ('fps', models.FloatField(default=15.0)),
                ('format', models.CharField(default='mp4', max_length=255)),
                ('file', models.FileField(blank=True, default='', max_length=255, upload_to=b'')),
                ('movie', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='renderings', to='timelapse_manager.Movie')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('_created_at', models.DateTimeField(auto_now_add=True)),
                ('_updated_at', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=255)),
                ('start_at', models.DateTimeField()),
                ('end_at', models.DateTimeField()),
                ('camera', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tags', to='timelapse_manager.Camera')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='TagInfo',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('_created_at', models.DateTimeField(auto_now_add=True)),
                ('_updated_at', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=255, unique=True)),
                ('description', models.TextField(blank=True, default=None)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.RemoveField(
            model_name='annotation',
            name='camera',
        ),
        migrations.RemoveField(
            model_name='annotation',
            name='tags',
        ),
        migrations.AlterField(
            model_name='image',
            name='scaled_at_160x120',
            field=easy_thumbnails.fields.ThumbnailerImageField(blank=True, default='', max_length=255, null=True, upload_to=functools.partial(timelapse_manager.storage.upload_to_thumbnail, *(), **{b'size': '160x120'})),
        ),
        migrations.AlterField(
            model_name='image',
            name='scaled_at_320x240',
            field=easy_thumbnails.fields.ThumbnailerImageField(blank=True, default='', max_length=255, null=True, upload_to=functools.partial(timelapse_manager.storage.upload_to_thumbnail, *(), **{b'size': '320x240'})),
        ),
        migrations.AlterField(
            model_name='image',
            name='scaled_at_640x480',
            field=easy_thumbnails.fields.ThumbnailerImageField(blank=True, default='', max_length=255, null=True, upload_to=functools.partial(timelapse_manager.storage.upload_to_thumbnail, *(), **{b'size': '640x480'})),
        ),
        migrations.DeleteModel(
            name='Annotation',
        ),
        migrations.AddField(
            model_name='movie',
            name='tags',
            field=models.ManyToManyField(to='timelapse_manager.TagInfo'),
        ),
    ]
