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

from django.db import models, migrations
import django.utils.timezone
from django.conf import settings

class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('trainings', '0016_data_pre_versionable_base'),
    ]

    operations = [
        migrations.AlterModelOptions(
            name='trainingsession',
            options={'ordering': ('start_date',)},
        ),
        migrations.RenameField(
            model_name='trainingsession',
            old_name='date_end',
            new_name='end_date',
        ),
        migrations.RenameField(
            model_name='trainingsession',
            old_name='date',
            new_name='start_date',
        ),
        migrations.RemoveField(
            model_name='training',
            name='addition_lock',
        ),
        migrations.RemoveField(
            model_name='training',
            name='hidden_lock',
        ),
        migrations.RemoveField(
            model_name='training',
            name='image',
        ),
        migrations.RemoveField(
            model_name='training',
            name='modification_lock',
        ),
        migrations.RemoveField(
            model_name='training',
            name='order_lock',
        ),
        migrations.RemoveField(
            model_name='training',
            name='public',
        ),
        migrations.RemoveField(
            model_name='training',
            name='version',
        ),
        migrations.AddField(
            model_name='training',
            name='created_at',
            field=models.DateTimeField(default=django.utils.timezone.now, verbose_name='Creation date'),
        ),
        migrations.AddField(
            model_name='training',
            name='original_version',
            field=models.ForeignKey(to='trainings.Training', related_name='all_duplicates', null=True),
        ),
        migrations.AlterField(
            model_name='training',
            name='owner',
            field=models.ForeignKey(related_name='trainings', to=settings.AUTH_USER_MODEL, verbose_name='owner'),
        ),
        migrations.AddField(
            model_name='training',
            name='parent_version',
            field=models.ForeignKey(to='trainings.Training', related_name='direct_duplicates', null=True),
        ),
        migrations.AddField(
            model_name='training',
            name='thumbnail_image',
            field=models.ImageField(blank=True, verbose_name='Thumbnail Image', upload_to='training', null=True),
        ),
        migrations.AddField(
            model_name='training',
            name='thumbnail_image_hash',
            field=models.CharField(blank=True, verbose_name='Thumbnail Image Hash', max_length=64),
        ),
        migrations.AddField(
            model_name='training',
            name='version_state',
            field=models.CharField(choices=[('c', 'Copied'), ('C', 'Copying'), ('d', 'Draft'), ('p', 'Published'), ('a', 'Archived')], default='d', verbose_name='Version state', max_length=1, db_index=True),
        ),
        migrations.AlterField(
            model_name='trainingsession',
            name='users',
            field=models.ManyToManyField(related_name='training_sessions', blank=True, verbose_name='trainees', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AlterField(
            model_name='training',
            name='name',
            field=models.CharField(max_length=30, verbose_name='name'),
        ),
        migrations.AlterField(
            model_name='trainingsession',
            name='training',
            field=models.ForeignKey(verbose_name='training', to='trainings.Training', related_name='training_sessions'),
        ),
    ]
