# -*- 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),
        ('accounts', '0009_add_assessments_stuff'),
        ('assessments', '0005_add_user_certification_data'),
    ]

    operations = [
        migrations.CreateModel(
            name='Curriculum',
            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)),
                ('name', models.CharField(max_length=255)),
                ('description', models.TextField(blank=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Lesson',
            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)),
                ('name', models.CharField(max_length=255)),
                ('type', models.CharField(max_length=2, default='el', choices=[('el', 'E-Learning'), ('di', 'Distance'), ('pr', 'Presence')])),
                ('duration', models.DurationField(null=True, blank=True)),
                ('description', models.TextField(blank=True)),
                ('is_active', models.BooleanField(default=True)),
                ('curriculum', models.ForeignKey(to='assessments.Curriculum', related_name='lessons')),
            ],
            options={
                'abstract': False,
                'ordering': ['sort_order'],
            },
        ),
        migrations.CreateModel(
            name='LessonDimensionWeight',
            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)),
                ('weight', models.PositiveIntegerField(default=0)),
                ('dimension', models.ForeignKey(to='assessments.Dimension', related_name='lesson_weights')),
                ('first_update', models.ForeignKey(related_name='lessondimensionweight_by_first', null=True, to='sync.Update', blank=True)),
                ('last_update', models.ForeignKey(related_name='lessondimensionweight_by_last', null=True, to='sync.Update', blank=True)),
                ('lesson', models.ForeignKey(to='assessments.Lesson', related_name='dimension_weights')),
            ],
            options={
                'ordering': ('-weight',),
            },
        ),
        migrations.CreateModel(
            name='LessonRecommendationThreshold',
            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)),
                ('threshold', models.PositiveIntegerField(default=0)),
                ('first_update', models.ForeignKey(related_name='lessonrecommendationthreshold_by_first', null=True, to='sync.Update', blank=True)),
                ('last_update', models.ForeignKey(related_name='lessonrecommendationthreshold_by_last', null=True, to='sync.Update', blank=True)),
                ('lesson', models.ForeignKey(to='assessments.Lesson', related_name='recommendation_thresholds')),
            ],
            options={
                'ordering': ('-threshold',),
            },
        ),
        migrations.CreateModel(
            name='RecommendationLevel',
            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)),
                ('name', models.CharField(max_length=255)),
                ('description', models.TextField(blank=True)),
                ('first_update', models.ForeignKey(related_name='recommendationlevel_by_first', null=True, to='sync.Update', blank=True)),
                ('last_update', models.ForeignKey(related_name='recommendationlevel_by_last', null=True, to='sync.Update', blank=True)),
            ],
            options={
                'abstract': False,
                'ordering': ['sort_order'],
            },
        ),
        migrations.CreateModel(
            name='Topic',
            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)),
                ('name', models.CharField(max_length=255)),
                ('description', models.TextField(blank=True)),
                ('first_update', models.ForeignKey(related_name='topic_by_first', null=True, to='sync.Update', blank=True)),
                ('last_update', models.ForeignKey(related_name='topic_by_last', null=True, to='sync.Update', blank=True)),
            ],
            options={
                'abstract': False,
                'ordering': ['sort_order'],
            },
        ),
        migrations.CreateModel(
            name='UserLessonRecommendation',
            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)),
                ('first_update', models.ForeignKey(related_name='userlessonrecommendation_by_first', null=True, to='sync.Update', blank=True)),
                ('last_update', models.ForeignKey(related_name='userlessonrecommendation_by_last', null=True, to='sync.Update', blank=True)),
                ('lesson', models.ForeignKey(to='assessments.Lesson', related_name='user_recommendations')),
                ('level', models.ForeignKey(to='assessments.RecommendationLevel', related_name='recommendations')),
                ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, related_name='lesson_recommendations')),
            ],
            options={
                'ordering': ('-level__order',),
            },
        ),
        migrations.AlterField(
            model_name='assessableactivitypartuserscore',
            name='user',
            field=models.ForeignKey(to=settings.AUTH_USER_MODEL, related_name='assessableactivitypartuserscores'),
        ),
        migrations.AlterField(
            model_name='assessableactivityuserscore',
            name='user',
            field=models.ForeignKey(to=settings.AUTH_USER_MODEL, related_name='assessableactivityuserscores'),
        ),
        migrations.AlterField(
            model_name='competencytreeuserscore',
            name='user',
            field=models.ForeignKey(to=settings.AUTH_USER_MODEL, related_name='competencytreeuserscores'),
        ),
        migrations.AlterField(
            model_name='competencyuserscore',
            name='user',
            field=models.ForeignKey(to=settings.AUTH_USER_MODEL, related_name='competencyuserscores'),
        ),
        migrations.AlterField(
            model_name='dimensionuserscore',
            name='user',
            field=models.ForeignKey(to=settings.AUTH_USER_MODEL, related_name='dimensionuserscores'),
        ),
        migrations.AddField(
            model_name='lessonrecommendationthreshold',
            name='level',
            field=models.ForeignKey(to='assessments.RecommendationLevel', related_name='lesson_thresholds'),
        ),
        migrations.AddField(
            model_name='lesson',
            name='dimensions',
            field=models.ManyToManyField(to='assessments.Dimension', blank=True, through='assessments.LessonDimensionWeight'),
        ),
        migrations.AddField(
            model_name='lesson',
            name='first_update',
            field=models.ForeignKey(related_name='lesson_by_first', null=True, to='sync.Update', blank=True),
        ),
        migrations.AddField(
            model_name='lesson',
            name='last_update',
            field=models.ForeignKey(related_name='lesson_by_last', null=True, to='sync.Update', blank=True),
        ),
        migrations.AddField(
            model_name='lesson',
            name='recommendation_levels',
            field=models.ManyToManyField(to='assessments.RecommendationLevel', blank=True, through='assessments.LessonRecommendationThreshold'),
        ),
        migrations.AddField(
            model_name='lesson',
            name='topic',
            field=models.ForeignKey(related_name='lessons', null=True, to='assessments.Topic', blank=True),
        ),
        migrations.AddField(
            model_name='curriculum',
            name='active_recommendation_levels',
            field=models.ManyToManyField(to='assessments.RecommendationLevel', blank=True),
        ),
        migrations.AddField(
            model_name='curriculum',
            name='first_update',
            field=models.ForeignKey(related_name='curriculum_by_first', null=True, to='sync.Update', blank=True),
        ),
        migrations.AddField(
            model_name='curriculum',
            name='job_profile',
            field=models.ForeignKey(related_name='curricula', null=True, to='accounts.Group', blank=True),
        ),
        migrations.AddField(
            model_name='curriculum',
            name='last_update',
            field=models.ForeignKey(related_name='curriculum_by_last', null=True, to='sync.Update', blank=True),
        ),
        migrations.AddField(
            model_name='curriculum',
            name='mgroups',
            field=models.ManyToManyField(to='accounts.Group', blank=True),
        ),
    ]
