# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations, models
import django_extensions.db.fields
from django.conf import settings


class Migration(migrations.Migration):

    dependencies = [
        ('trainings', '0043_trainingactivity_session'),
        ('sync', '0002_auto_20150831_1334'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Photo',
            fields=[
                ('sort_order', models.IntegerField(blank=True, db_index=True)),
                ('id', django_extensions.db.fields.UUIDField(editable=False, blank=True, primary_key=True, serialize=False)),
                ('is_deleted', models.BooleanField(default=False)),
                ('update_locally', models.BooleanField(default=False)),
                ('created', django_extensions.db.fields.CreationDateTimeField(verbose_name='created', auto_now_add=True)),
                ('modified', django_extensions.db.fields.ModificationDateTimeField(verbose_name='modified', auto_now=True)),
                ('image', models.ImageField(verbose_name='image', upload_to='photos')),
                ('image_hash', models.CharField(blank=True, max_length=64)),
                ('first_update', models.ForeignKey(related_name='photostories_photo_by_first', blank=True, null=True, to='sync.Update')),
                ('last_update', models.ForeignKey(related_name='photostories_photo_by_last', blank=True, null=True, to='sync.Update')),
            ],
            options={
                'abstract': False,
                'ordering': ['sort_order'],
            },
        ),
        migrations.CreateModel(
            name='Photostory',
            fields=[
                ('trainingactivity_ptr', models.OneToOneField(to='trainings.TrainingActivity', auto_created=True, primary_key=True, parent_link=True, serialize=False)),
            ],
            options={
                'abstract': False,
            },
            bases=('trainings.trainingactivity',),
        ),
        migrations.CreateModel(
            name='Strip',
            fields=[
                ('id', django_extensions.db.fields.UUIDField(editable=False, blank=True, primary_key=True, serialize=False)),
                ('is_deleted', models.BooleanField(default=False)),
                ('update_locally', models.BooleanField(default=False)),
                ('created', django_extensions.db.fields.CreationDateTimeField(verbose_name='created', auto_now_add=True)),
                ('modified', django_extensions.db.fields.ModificationDateTimeField(verbose_name='modified', auto_now=True)),
                ('name', models.CharField(verbose_name='name', max_length=150)),
                ('state', models.CharField(verbose_name='state', default='on', max_length=2, choices=[('on', 'Ongoing'), ('pu', 'Published')])),
                ('first_update', models.ForeignKey(related_name='photostories_strip_by_first', blank=True, null=True, to='sync.Update')),
                ('last_update', models.ForeignKey(related_name='photostories_strip_by_last', blank=True, null=True, to='sync.Update')),
                ('owner', models.ForeignKey(related_name='strips', verbose_name='owner', to=settings.AUTH_USER_MODEL)),
                ('photostory', models.ForeignKey(related_name='strips', verbose_name='photostory', to='photostories.Photostory')),
                ('session', models.ForeignKey(related_name='strips', verbose_name='session', to='trainings.TrainingSession')),
            ],
            options={
                'get_latest_by': 'modified',
                'abstract': False,
                'ordering': ('-modified', '-created'),
            },
        ),
        migrations.AddField(
            model_name='photo',
            name='strip',
            field=models.ForeignKey(related_name='photos', to='photostories.Strip'),
        ),
    ]
