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

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


class Migration(migrations.Migration):

    dependencies = [
        ('sync', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('trainings', '0013_training_trainer_groups_help_text'),
    ]

    operations = [
        migrations.CreateModel(
            name='Criterion',
            fields=[
                ('sort_order', models.IntegerField(blank=True, db_index=True)),
                ('id', django_extensions.db.fields.UUIDField(blank=True, serialize=False, primary_key=True, editable=False)),
                ('is_deleted', models.BooleanField(default=False)),
                ('update_locally', models.BooleanField(default=False)),
                ('name', models.CharField(max_length=500, verbose_name='name')),
                ('description', models.TextField(blank=True, verbose_name='description')),
                ('criterion_type', models.CharField(help_text='Type of criterion', max_length=2, blank=True, default='ql', choices=[('ql', 'Qualitative'), ('qt', 'Quantitative')], verbose_name='criterion type')),
                ('first_update', models.ForeignKey(to='sync.Update', related_name='criterion_by_first', blank=True, null=True)),
                ('last_update', models.ForeignKey(to='sync.Update', related_name='criterion_by_last', blank=True, null=True)),
            ],
            options={
                'abstract': False,
                'ordering': ['sort_order'],
            },
        ),
        migrations.CreateModel(
            name='Rating',
            fields=[
                ('id', django_extensions.db.fields.UUIDField(blank=True, serialize=False, primary_key=True, editable=False)),
                ('is_deleted', models.BooleanField(default=False)),
                ('update_locally', models.BooleanField(default=False)),
                ('text', models.TextField(blank=True)),
                ('score', models.PositiveIntegerField()),
                ('criterion', models.ForeignKey(to='roleplays.Criterion')),
                ('first_update', models.ForeignKey(to='sync.Update', related_name='rating_by_first', blank=True, null=True)),
                ('last_update', models.ForeignKey(to='sync.Update', related_name='rating_by_last', blank=True, null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Roleplay',
            fields=[
                ('id', django_extensions.db.fields.UUIDField(blank=True, serialize=False, primary_key=True, editable=False)),
                ('is_deleted', models.BooleanField(default=False)),
                ('update_locally', models.BooleanField(default=False)),
                ('name', models.CharField(max_length=500, verbose_name='name')),
                ('description', models.TextField(blank=True, verbose_name='description')),
                ('is_criteria_ratings_editable', models.BooleanField(default=True, verbose_name='is criteria ratings editable ?')),
                ('criteria_rating_scale', models.PositiveIntegerField(default=2, verbose_name='number of step for rating of the quantitative criteria')),
                ('author', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
                ('first_update', models.ForeignKey(to='sync.Update', related_name='roleplay_by_first', blank=True, null=True)),
                ('last_update', models.ForeignKey(to='sync.Update', related_name='roleplay_by_last', blank=True, null=True)),
                ('training', models.ForeignKey(to='trainings.Training')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Step',
            fields=[
                ('sort_order', models.IntegerField(blank=True, db_index=True)),
                ('id', django_extensions.db.fields.UUIDField(blank=True, serialize=False, primary_key=True, editable=False)),
                ('is_deleted', models.BooleanField(default=False)),
                ('update_locally', models.BooleanField(default=False)),
                ('name', models.CharField(max_length=500, verbose_name='name')),
                ('description', models.TextField(blank=True, verbose_name='description')),
                ('duration', models.DurationField(verbose_name='expected duration')),
                ('first_update', models.ForeignKey(to='sync.Update', related_name='step_by_first', blank=True, null=True)),
                ('last_update', models.ForeignKey(to='sync.Update', related_name='step_by_last', blank=True, null=True)),
                ('roleplay', models.ForeignKey(related_name='steps', to='roleplays.Roleplay')),
            ],
            options={
                'abstract': False,
                'ordering': ['sort_order'],
            },
        ),
        migrations.AddField(
            model_name='rating',
            name='roleplay',
            field=models.ForeignKey(to='roleplays.Roleplay'),
        ),
        migrations.AddField(
            model_name='rating',
            name='trainee',
            field=models.ForeignKey(to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='rating',
            name='training_session',
            field=models.ForeignKey(to='trainings.TrainingSession'),
        ),
        migrations.AddField(
            model_name='criterion',
            name='step',
            field=models.ForeignKey(related_name='criterias', to='roleplays.Step'),
        ),
    ]
