# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-06-07 15:15
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import webapp.utils


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("webapp", "0006_delete_deprecated_models"),
    ]

    operations = [
        migrations.CreateModel(
            name="BaseFeed",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("visible", models.BooleanField(default=True)),
                ("title", models.CharField(max_length=255)),
                ("description", models.CharField(max_length=255)),
                ("content", models.TextField()),
            ],
        ),
        migrations.CreateModel(
            name="Tag",
            fields=[
                ("slug", models.SlugField(primary_key=True, serialize=False)),
                ("name", models.CharField(max_length=127)),
                ("icon", models.ImageField(upload_to="")),
            ],
        ),
        migrations.CreateModel(
            name="Event",
            fields=[
                (
                    "basefeed_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="webapp.BaseFeed",
                    ),
                ),
                ("start_time", models.DateTimeField(default=django.utils.timezone.now)),
                ("end_time", models.DateTimeField(default=django.utils.timezone.now)),
            ],
            bases=("webapp.basefeed",),
        ),
        migrations.CreateModel(
            name="Feed",
            fields=[
                (
                    "basefeed_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="webapp.BaseFeed",
                    ),
                ),
                (
                    "publish_time",
                    models.DateTimeField(default=django.utils.timezone.now),
                ),
                ("autohide", models.DateTimeField(default=webapp.utils.month_from_now)),
            ],
            bases=("webapp.basefeed",),
        ),
        migrations.AddField(
            model_name="basefeed",
            name="tags",
            field=models.ManyToManyField(
                blank=True, related_name="feeds", to="webapp.Tag"
            ),
        ),
    ]
