# Generated by Django 2.1.5 on 2019-03-04 08:24

import ckeditor_uploader.fields
import django.contrib.gis.db.models.fields
from django.contrib.postgres.operations import CreateExtension
from django.db import migrations, models
import django.db.models.deletion
import utils.get_upload_filepath


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        CreateExtension('postgis'),
        migrations.CreateModel(
            name='Event',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
                ('description', ckeditor_uploader.fields.RichTextUploadingField()),
                ('registration_link', models.URLField(blank=True)),
                ('published', models.BooleanField(default=False)),
                ('start', models.DateTimeField()),
                ('end', models.DateTimeField()),
            ],
        ),
        migrations.CreateModel(
            name='Location',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
                ('description', ckeditor_uploader.fields.RichTextUploadingField()),
                ('coords', django.contrib.gis.db.models.fields.PointField(srid=4326)),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='Organiser',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('url', models.URLField(blank=True)),
                ('logo', models.ImageField(blank=True, help_text='Logo will be displayed instead of name if provided.', null=True, upload_to=utils.get_upload_filepath.get_event_organiser_upload_path)),
            ],
        ),
        migrations.CreateModel(
            name='Series',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
                ('abbreviation', models.CharField(max_length=30)),
                ('description', ckeditor_uploader.fields.RichTextUploadingField()),
                ('logo', models.ImageField(blank=True, help_text='Logo will be displayed instead of name if provided.', null=True, upload_to=utils.get_upload_filepath.get_event_series_upload_path)),
            ],
            options={
                'verbose_name_plural': 'series',
            },
        ),
        migrations.CreateModel(
            name='Session',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
                ('description', ckeditor_uploader.fields.RichTextUploadingField()),
                ('url', models.URLField(blank=True)),
                ('url_label', models.CharField(max_length=200)),
                ('start', models.DateTimeField()),
                ('end', models.DateTimeField()),
                ('event', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='sessions', to='events.Event')),
                ('locations', models.ManyToManyField(blank=True, related_name='sessions', to='events.Location')),
            ],
        ),
        migrations.CreateModel(
            name='Sponsor',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('url', models.URLField(blank=True)),
                ('logo', models.ImageField(blank=True, help_text='Logo will be displayed instead of name if provided.', null=True, upload_to=utils.get_upload_filepath.get_event_sponsor_upload_path)),
            ],
        ),
        migrations.AddField(
            model_name='event',
            name='locations',
            field=models.ManyToManyField(blank=True, related_name='events', to='events.Location'),
        ),
        migrations.AddField(
            model_name='event',
            name='organisers',
            field=models.ManyToManyField(blank=True, related_name='events', to='events.Organiser'),
        ),
        migrations.AddField(
            model_name='event',
            name='series',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='events', to='events.Series'),
        ),
        migrations.AddField(
            model_name='event',
            name='sponsors',
            field=models.ManyToManyField(blank=True, related_name='events', to='events.Sponsor'),
        ),
    ]
