# Generated by Django 2.0.3 on 2018-04-07 11:03

import datetime
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.db.models.manager


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='BaseEvent',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(default='', max_length=200)),
                ('description', models.TextField()),
                ('preview', models.ImageField(default='', upload_to='previews')),
                ('date', models.DateTimeField(default=datetime.date.today)),
            ],
            managers=[
                ('event_manager', django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name='EventSubscription',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
        ),
        migrations.CreateModel(
            name='Location',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('lat', models.FloatField()),
                ('lng', models.FloatField()),
                ('address', models.CharField(default='', max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='Event',
            fields=[
                ('baseevent_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='main.BaseEvent')),
            ],
            bases=('main.baseevent',),
            managers=[
                ('event_manager', django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name='Trip',
            fields=[
                ('baseevent_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='main.BaseEvent')),
            ],
            bases=('main.baseevent',),
            managers=[
                ('event_manager', django.db.models.manager.Manager()),
            ],
        ),
        migrations.AddField(
            model_name='location',
            name='event',
            field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to='main.BaseEvent'),
        ),
        migrations.AddField(
            model_name='eventsubscription',
            name='event',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='main.BaseEvent'),
        ),
        migrations.AddField(
            model_name='eventsubscription',
            name='subscriber',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='baseevent',
            name='creater',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AlterUniqueTogether(
            name='eventsubscription',
            unique_together={('subscriber', 'event')},
        ),
    ]
