# Generated by Django 3.0.5 on 2020-05-27 12:57

import django.core.validators
import django.db.models.deletion
import modelcluster.fields
from django.db import migrations, models


class Migration(migrations.Migration):
    dependencies = [
        ('wagtailimages', '0001_squashed_0021'),
        ('wagtailcore', '0045_assign_unlock_grouppagepermission'),
        ('wagtailredirects', '0006_redirect_increase_max_length'),
        ('wagtailforms', '0004_add_verbose_name_plural'),
    ]

    operations = [
        migrations.AlterField(
            model_name='event',
            name='event_speaker',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL,
                                    to='agenda.Speaker'),
        ),
        migrations.CreateModel(
            name='Sponsor',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=128)),
                ('logo', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL,
                                           related_name='+', to='wagtailimages.Image')),
            ],
            options={
                'verbose_name': 'Sponsor',
                'verbose_name_plural': 'Sponsors',
            },
        ),
        migrations.AddField(
            model_name='event',
            name='sponsor',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT,
                                    to='agenda.Sponsor'),
        ),
        migrations.AddField(
            model_name='event',
            name='recording',
            field=models.URLField(blank=True, max_length=512, null=True),
        ),
        migrations.RemoveField(
            model_name='event',
            name='event_category',
        ),
        migrations.DeleteModel(
            name='Category',
        ),
        migrations.DeleteModel(
            name='CategoryIndex',
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('name_en', models.CharField(max_length=100, null=True)),
                ('name_pl', models.CharField(max_length=100, null=True)),
                ('icon', models.CharField(max_length=300)),
                ('color', models.CharField(default='#23211f', max_length=7, validators=[
                    django.core.validators.RegexValidator(message='Color must be in hex', regex='^#([0-9a-fA-F]{6})$')],
                                           verbose_name='Category color')),
                ('edition', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE,
                                                            related_name='event_categories', to='agenda.Edition')),
            ],
            options={
                'verbose_name': 'Event category',
                'verbose_name_plural': 'Event categories',
            },
        ),
        migrations.AddField(
            model_name='event',
            name='event_category',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL,
                                    to='agenda.Category'),
        ),
        migrations.AddField(
            model_name='speaker',
            name='sponsor',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT,
                                    to='agenda.Sponsor'),
        ),
        migrations.AddField(
            model_name='event',
            name='duration_minutes',
            field=models.IntegerField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='event',
            name='language',
            field=models.CharField(choices=[('pl', 'Polish'), ('en', 'English')], default='pl', max_length=5),
            preserve_default=False,
        ),
        migrations.AlterModelOptions(
            name='edition',
            options={'verbose_name': 'Edition', 'verbose_name_plural': 'Editions'},
        ),
        migrations.AlterModelOptions(
            name='editionindex',
            options={'verbose_name': 'Edition index', 'verbose_name_plural': 'Edition indexes'},
        ),
        migrations.AlterModelOptions(
            name='event',
            options={'verbose_name': 'Event', 'verbose_name_plural': 'Events'},
        ),
        migrations.AlterModelOptions(
            name='eventindex',
            options={'verbose_name': 'Event list', 'verbose_name_plural': 'Event lists'},
        ),
        migrations.AlterModelOptions(
            name='speaker',
            options={'verbose_name': 'Speaker', 'verbose_name_plural': 'Speakers'},
        ),
        migrations.AlterModelOptions(
            name='speakerindex',
            options={'verbose_name': 'Speakers index', 'verbose_name_plural': 'Speakers indexes'},
        ),
        migrations.AlterField(
            model_name='event',
            name='event_speaker',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='agenda.Speaker'),
        ),
        migrations.AlterField(
            model_name='event',
            name='language',
            field=models.CharField(blank=True, choices=[('pl', 'Polish'), ('en', 'English')], max_length=5, null=True),
        ),
        migrations.AddField(
            model_name='eventindex',
            name='color',
            field=models.CharField(default='#23211f', max_length=7, validators=[
                django.core.validators.RegexValidator(message='Color must be in hex', regex='^#([0-9a-fA-F]{6})$')],
                                   verbose_name='Index color'),
        ),
        migrations.CreateModel(
            name='SocialLink',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('type', models.CharField(
                    choices=[('facebook', 'Facebook'), ('twitter', 'Twitter'), ('github', 'Github'),
                             ('instagram', 'Instagram'), ('linkedin', 'Linkedin'), ('email', 'Email'),
                             ('site', 'Website'), ('other', 'Other')], default='other', max_length=16)),
                ('link', models.URLField(max_length=512)),
                ('speaker', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE,
                                                            related_name='social_links', to='agenda.Speaker')),
            ],
        ),
    ]
