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

from django.db import migrations, models
import django_extensions.db.fields
from django.conf import settings
import django.core.validators
import mtp.apps.trainings.models.sessions


class Migration(migrations.Migration):

    dependencies = [
        ('sync', '0003_add_index_on_update_synchornized'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('trainings', '0045_add_missing_verbose_name'),
    ]

    operations = [
        migrations.CreateModel(
            name='Brainstorming',
            fields=[
                ('trainingactivity_ptr', models.OneToOneField(parent_link=True, to='trainings.TrainingActivity', primary_key=True, serialize=False, auto_created=True)),
                ('is_anonymous', models.BooleanField(verbose_name='Anonymous', default=False)),
            ],
            options={
                'abstract': False,
            },
            bases=('trainings.trainingactivity', models.Model),
        ),
        migrations.CreateModel(
            name='BrainstormingIdea',
            fields=[
                ('sort_order', models.IntegerField(blank=True, db_index=True)),
                ('id', django_extensions.db.fields.UUIDField(primary_key=True, blank=True, serialize=False, editable=False)),
                ('is_deleted', models.BooleanField(default=False)),
                ('update_locally', models.BooleanField(default=False)),
                ('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
                ('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
                ('text', models.CharField(max_length=80, verbose_name='Text')),
                ('brainstorming', models.ForeignKey(verbose_name='Brainstorming', to='ideas.Brainstorming', related_name='ideas')),
                ('first_update', models.ForeignKey(null=True, blank=True, to='sync.Update', related_name='ideas_brainstormingidea_by_first')),
                ('last_update', models.ForeignKey(null=True, blank=True, to='sync.Update', related_name='ideas_brainstormingidea_by_last')),
                ('original_version', models.ForeignKey(null=True, to='ideas.BrainstormingIdea', related_name='all_duplicates')),
                ('parent_version', models.ForeignKey(null=True, to='ideas.BrainstormingIdea', related_name='direct_duplicates')),
                ('session', models.ForeignKey(null=True, verbose_name='Session', blank=True, to='trainings.TrainingSession', related_name='brainstormingidea_ideas')),
            ],
            bases=(mtp.apps.trainings.models.sessions.LiveDependencyMixin, models.Model),
        ),
        migrations.CreateModel(
            name='BrainstormingTag',
            fields=[
                ('sort_order', models.IntegerField(blank=True, db_index=True)),
                ('id', django_extensions.db.fields.UUIDField(primary_key=True, blank=True, serialize=False, editable=False)),
                ('is_deleted', models.BooleanField(default=False)),
                ('update_locally', models.BooleanField(default=False)),
                ('name', models.CharField(max_length=50, verbose_name='Name')),
                ('color', models.CharField(max_length=30, blank=True, null=True, verbose_name='Color')),
                ('brainstorming', models.ForeignKey(verbose_name='Brainstorming', to='ideas.Brainstorming', related_name='tags')),
                ('first_update', models.ForeignKey(null=True, blank=True, to='sync.Update', related_name='ideas_brainstormingtag_by_first')),
                ('last_update', models.ForeignKey(null=True, blank=True, to='sync.Update', related_name='ideas_brainstormingtag_by_last')),
                ('original_version', models.ForeignKey(null=True, to='ideas.BrainstormingTag', related_name='all_duplicates')),
                ('parent_version', models.ForeignKey(null=True, to='ideas.BrainstormingTag', related_name='direct_duplicates')),
                ('session', models.ForeignKey(null=True, verbose_name='Session', blank=True, to='trainings.TrainingSession', related_name='brainstorming_tags')),
            ],
            bases=(mtp.apps.trainings.models.sessions.LiveDependencyMixin, models.Model),
        ),
        migrations.CreateModel(
            name='QuestionWall',
            fields=[
                ('trainingactivity_ptr', models.OneToOneField(parent_link=True, to='trainings.TrainingActivity', primary_key=True, serialize=False, auto_created=True)),
                ('is_anonymous', models.BooleanField(verbose_name='Anonymous', default=False)),
            ],
            options={
                'abstract': False,
            },
            bases=('trainings.trainingactivity', models.Model),
        ),
        migrations.CreateModel(
            name='QuestionWallIdea',
            fields=[
                ('sort_order', models.IntegerField(blank=True, db_index=True)),
                ('id', django_extensions.db.fields.UUIDField(primary_key=True, blank=True, serialize=False, editable=False)),
                ('is_deleted', models.BooleanField(default=False)),
                ('update_locally', models.BooleanField(default=False)),
                ('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
                ('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
                ('text', models.CharField(max_length=140, verbose_name='Text')),
                ('first_update', models.ForeignKey(null=True, blank=True, to='sync.Update', related_name='ideas_questionwallidea_by_first')),
                ('last_update', models.ForeignKey(null=True, blank=True, to='sync.Update', related_name='ideas_questionwallidea_by_last')),
                ('questionwall', models.ForeignKey(verbose_name='Question wall', to='ideas.QuestionWall', related_name='ideas')),
                ('session', models.ForeignKey(null=True, verbose_name='Session', blank=True, to='trainings.TrainingSession', related_name='questionwallidea_ideas')),
                ('user', models.ForeignKey(null=True, verbose_name='User', blank=True, to=settings.AUTH_USER_MODEL, related_name='questionwallidea_ideas')),
            ],
        ),
        migrations.CreateModel(
            name='WordCloud',
            fields=[
                ('trainingactivity_ptr', models.OneToOneField(parent_link=True, to='trainings.TrainingActivity', primary_key=True, serialize=False, auto_created=True)),
                ('is_anonymous', models.BooleanField(verbose_name='Anonymous', default=False)),
            ],
            options={
                'abstract': False,
            },
            bases=('trainings.trainingactivity', models.Model),
        ),
        migrations.CreateModel(
            name='WordCloudIdea',
            fields=[
                ('sort_order', models.IntegerField(blank=True, db_index=True)),
                ('id', django_extensions.db.fields.UUIDField(primary_key=True, blank=True, serialize=False, editable=False)),
                ('is_deleted', models.BooleanField(default=False)),
                ('update_locally', models.BooleanField(default=False)),
                ('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
                ('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
                ('text', models.CharField(max_length=30, validators=[django.core.validators.RegexValidator(regex='^[^\\s]+$', message='No spaces are allowed')], verbose_name='Text')),
                ('first_update', models.ForeignKey(null=True, blank=True, to='sync.Update', related_name='ideas_wordcloudidea_by_first')),
                ('last_update', models.ForeignKey(null=True, blank=True, to='sync.Update', related_name='ideas_wordcloudidea_by_last')),
                ('session', models.ForeignKey(null=True, verbose_name='Session', blank=True, to='trainings.TrainingSession', related_name='wordcloudidea_ideas')),
                ('user', models.ForeignKey(null=True, verbose_name='User', blank=True, to=settings.AUTH_USER_MODEL, related_name='wordcloudidea_ideas')),
                ('wordcloud', models.ForeignKey(verbose_name='Word cloud', to='ideas.WordCloud', related_name='ideas')),
            ],
        ),
        migrations.AddField(
            model_name='brainstormingidea',
            name='tags',
            field=models.ManyToManyField(to='ideas.BrainstormingTag', related_name='ideas', verbose_name='Tags'),
        ),
        migrations.AddField(
            model_name='brainstormingidea',
            name='user',
            field=models.ForeignKey(null=True, verbose_name='User', blank=True, to=settings.AUTH_USER_MODEL, related_name='brainstormingidea_ideas'),
        ),
        migrations.AlterUniqueTogether(
            name='wordcloudidea',
            unique_together=set([('wordcloud', 'session', 'sort_order')]),
        ),
        migrations.AlterUniqueTogether(
            name='questionwallidea',
            unique_together=set([('questionwall', 'session', 'sort_order')]),
        ),
        migrations.AlterUniqueTogether(
            name='brainstormingtag',
            unique_together=set([('brainstorming', 'session', 'sort_order')]),
        ),
        migrations.AlterUniqueTogether(
            name='brainstormingidea',
            unique_together=set([('brainstorming', 'session', 'sort_order')]),
        ),
    ]
