# Generated by Django 2.0.8 on 2018-10-16 02:53

import colorfield.fields
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
import wagtail.core.fields


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('wagtailcore', '0040_page_draft_title'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('wagtailimages', '0021_image_file_hash'),
        ('home', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Activity',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text='The name of the activity', max_length=50)),
                ('description', models.TextField(help_text='A description of the activity')),
            ],
        ),
        migrations.CreateModel(
            name='ActivOut',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('activity', models.ForeignKey(help_text='The activity in the activity-outcome pair', null=True, on_delete=django.db.models.deletion.SET_NULL, to='home.Activity')),
            ],
        ),
        migrations.CreateModel(
            name='BlogPageGalleryImage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sort_order', models.IntegerField(blank=True, editable=False, null=True)),
                ('caption', models.CharField(blank=True, max_length=250)),
                ('image', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='wagtailimages.Image')),
            ],
            options={
                'ordering': ['sort_order'],
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Connection',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('direction', models.CharField(choices=[('UND', 'undirected'), ('DIR', 'directed'), ('MUT', 'mutual')], default='UND', help_text='The direction of the connection, should usually be undirected', max_length=3)),
            ],
        ),
        migrations.CreateModel(
            name='Element',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('label', models.CharField(help_text='The label for the element as shown on the map', max_length=50)),
                ('description', models.TextField(help_text='A description of the element as shown in the sidebar')),
                ('type', models.CharField(choices=[('G', 'Galaxy'), ('C', 'Constellation'), ('S', 'Star')], help_text='The type of the element: galaxy, constellation, or star', max_length=14)),
                ('activOuts', models.ManyToManyField(blank=True, help_text='For stars: activity-outcome pairs related to this issue', related_name='elements', to='home.ActivOut')),
                ('child', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='parent', to='home.Element')),
            ],
        ),
        migrations.CreateModel(
            name='EmbedLink',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('type', models.CharField(choices=[('G', 'Galaxy'), ('C', 'Constellation'), ('U', 'Universe')], max_length=1)),
                ('universeName', models.CharField(default='NotAUniverse', help_text="Name to be displayed if this is a universe.                                     Else the relatedElement's label will take this place.", max_length=50)),
                ('description', models.TextField()),
                ('mapSlug', models.SlugField()),
                ('viewSlug', models.SlugField()),
                ('embedURL', models.URLField(max_length=255)),
                ('bare', models.BooleanField()),
                ('simple', models.BooleanField()),
                ('scroll', models.BooleanField()),
            ],
            options={
                'permissions': (('view_map', 'Can view the insight map (is a paying customer)'),),
            },
        ),
        migrations.CreateModel(
            name='NodeBlogPage',
            fields=[
                ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
                ('date', models.DateField(verbose_name='Updated on')),
                ('body', wagtail.core.fields.RichTextField(blank=True)),
                ('element', models.ForeignKey(limit_choices_to={'type': 'C'}, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='blogPage', to='home.Element')),
            ],
            options={
                'abstract': False,
            },
            bases=('wagtailcore.page',),
        ),
        migrations.CreateModel(
            name='Outcome',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text='The name of the outcome', max_length=50)),
                ('description', models.TextField(help_text='A description of the outcome')),
            ],
        ),
        migrations.CreateModel(
            name='StarBlogPage',
            fields=[
                ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
                ('date', models.DateField(verbose_name='Updated on')),
                ('body', wagtail.core.fields.RichTextField(blank=True)),
                ('colour', colorfield.fields.ColorField(default='#FFFFFF', max_length=18)),
                ('element', models.ForeignKey(limit_choices_to={'type': 'S'}, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='starBlogPage', to='home.Element')),
            ],
            options={
                'abstract': False,
            },
            bases=('wagtailcore.page',),
        ),
        migrations.CreateModel(
            name='UserAttributes',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
        ),
        migrations.CreateModel(
            name='UserInterest',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('activOut', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='home.ActivOut')),
                ('element', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='home.Element')),
            ],
        ),
        migrations.AddField(
            model_name='userattributes',
            name='interests',
            field=models.ManyToManyField(blank=True, to='home.UserInterest'),
        ),
        migrations.AddField(
            model_name='userattributes',
            name='user',
            field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='userattributes', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='element',
            name='relatedView',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='relatedElement', to='home.EmbedLink'),
        ),
        migrations.AddField(
            model_name='element',
            name='tags',
            field=models.ManyToManyField(related_name='elements', to='home.EmbedLink'),
        ),
        migrations.AddField(
            model_name='connection',
            name='a',
            field=models.ForeignKey(help_text='The first element to be connected', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='a', to='home.Element'),
        ),
        migrations.AddField(
            model_name='connection',
            name='b',
            field=models.ForeignKey(help_text='The second element to be connected', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='b', to='home.Element'),
        ),
        migrations.AddField(
            model_name='blogpagegalleryimage',
            name='page',
            field=modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='gallery_images', to='home.StarBlogPage'),
        ),
        migrations.AddField(
            model_name='activout',
            name='outcome',
            field=models.ForeignKey(help_text='The outcome in the activity-outcome pair', null=True, on_delete=django.db.models.deletion.SET_NULL, to='home.Outcome'),
        ),
        migrations.AlterUniqueTogether(
            name='userinterest',
            unique_together={('activOut', 'element')},
        ),
        migrations.AlterUniqueTogether(
            name='activout',
            unique_together={('activity', 'outcome')},
        ),
    ]
