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

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


class Migration(migrations.Migration):

    dependencies = [
        ('workshops', '__first__'),
        ('accounts', '0001_initial'),
        ('trainings', '__first__'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('sync', '__first__'),
    ]

    operations = [
        migrations.CreateModel(
            name='Challenge',
            fields=[
                ('is_deleted', models.BooleanField(default=False)),
                ('update_locally', models.BooleanField(default=False)),
                ('id', django_extensions.db.fields.UUIDField(editable=False, primary_key=True, serialize=False, blank=True)),
                ('name', models.CharField(max_length=100)),
                ('first_update', models.ForeignKey(related_name='challenge_by_first', to='sync.Update', blank=True, null=True)),
                ('last_update', models.ForeignKey(related_name='challenge_by_last', to='sync.Update', blank=True, null=True)),
                ('mgroups', models.ManyToManyField(to='accounts.Group')),
                ('questions', models.ManyToManyField(to='workshops.WorkshopQuestion')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ChallengeSession',
            fields=[
                ('is_deleted', models.BooleanField(default=False)),
                ('update_locally', models.BooleanField(default=False)),
                ('id', django_extensions.db.fields.UUIDField(editable=False, primary_key=True, serialize=False, blank=True)),
                ('challenge', models.ForeignKey(to='challenges.Challenge')),
                ('first_update', models.ForeignKey(related_name='challengesession_by_first', to='sync.Update', blank=True, null=True)),
                ('last_update', models.ForeignKey(related_name='challengesession_by_last', to='sync.Update', blank=True, null=True)),
                ('sessions', models.ManyToManyField(to='trainings.TrainingSession')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ChallengeSessionUserScore',
            fields=[
                ('is_deleted', models.BooleanField(default=False)),
                ('update_locally', models.BooleanField(default=False)),
                ('id', django_extensions.db.fields.UUIDField(editable=False, primary_key=True, serialize=False, blank=True)),
                ('score', models.IntegerField(default=0)),
                ('challenge_session', models.ForeignKey(to='challenges.ChallengeSession')),
                ('first_update', models.ForeignKey(related_name='challengesessionuserscore_by_first', to='sync.Update', blank=True, null=True)),
                ('last_update', models.ForeignKey(related_name='challengesessionuserscore_by_last', to='sync.Update', blank=True, null=True)),
                ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('-score',),
            },
        ),
    ]
