# -*- coding: utf-8 -*-
# Generated by Django 1.9.3 on 2016-03-25 16:47
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('taggit', '0002_auto_20150616_2121'),
    ]

    operations = [
        migrations.CreateModel(
            name='Annotation',
            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(blank=True, default='', max_length=255)),
                ('notes', models.TextField(blank=True, default='')),
                ('start_at', models.DateTimeField(blank=True, default=None, null=True)),
                ('end_at', models.DateTimeField(blank=True, default=None, null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Camera',
            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(blank=True, default='', max_length=255)),
                ('notes', models.TextField(blank=True, default='')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Day',
            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)),
                ('date', models.DateField()),
                ('camera', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='days', to='timelapse_manager.Camera')),
            ],
            options={
                'ordering': ('-date',),
            },
        ),
        migrations.CreateModel(
            name='Image',
            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(blank=True, default='', max_length=255)),
                ('shot_at', models.DateTimeField(blank=True, default=None, null=True)),
                ('original', easy_thumbnails.fields.ThumbnailerImageField(blank=True, default='', null=True, upload_to=b'')),
                ('scaled_at_160x120', easy_thumbnails.fields.ThumbnailerImageField(blank=True, default='', null=True, upload_to=functools.partial(timelapse_manager.storage.upload_to_thumbnail, *(), **{b'size': '160x120'}))),
                ('scaled_at_320x240', easy_thumbnails.fields.ThumbnailerImageField(blank=True, default='', null=True, upload_to=functools.partial(timelapse_manager.storage.upload_to_thumbnail, *(), **{b'size': '320x240'}))),
                ('scaled_at_640x480', easy_thumbnails.fields.ThumbnailerImageField(blank=True, default='', null=True, upload_to=functools.partial(timelapse_manager.storage.upload_to_thumbnail, *(), **{b'size': '640x480'}))),
                ('camera', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='images', to='timelapse_manager.Camera')),
            ],
        ),
        migrations.AddField(
            model_name='day',
            name='cover',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='cover_for_days', to='timelapse_manager.Image'),
        ),
        migrations.AddField(
            model_name='day',
            name='key_frames',
            field=models.ManyToManyField(blank=True, related_name='keyframe_for_days', to='timelapse_manager.Image'),
        ),
        migrations.AddField(
            model_name='annotation',
            name='camera',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='annotations', to='timelapse_manager.Camera'),
        ),
        migrations.AddField(
            model_name='annotation',
            name='tags',
            field=taggit.managers.TaggableManager(help_text='A comma-separated list of tags.', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='Tags'),
        ),
        migrations.AlterUniqueTogether(
            name='image',
            unique_together=set([('camera', 'name')]),
        ),
    ]
