# Generated by Django 2.0 on 2018-01-16 13:52

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Comments',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=200)),
                ('short_summary', models.CharField(max_length=1000)),
            ],
        ),
        migrations.CreateModel(
            name='Summary',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=255)),
                ('text', models.CharField(max_length=8000)),
                ('link_original_article', models.CharField(max_length=255)),
                ('publisher_original_article', models.CharField(max_length=255)),
                ('name_author_original_article', models.CharField(max_length=255)),
                ('publication_date_original_article', models.DateField()),
                ('publication_country_original_article', models.CharField(max_length=255)),
                ('submission_date_summary', models.DateTimeField(auto_now_add=True)),
                ('slug', models.SlugField(blank=True, max_length=255)),
            ],
            options={
                'ordering': ('submission_date_summary',),
            },
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=200)),
                ('tag', models.CharField(choices=[('WHO', 'Who-tag'), ('WHERE', 'Where-tag'), ('WHAT', 'What-tag'), ('WHEN', 'When-tag')], default='WHAT', max_length=5)),
            ],
        ),
        migrations.AddField(
            model_name='summary',
            name='tags',
            field=models.ManyToManyField(db_table='articletag', to='summaries.Tag'),
        ),
        migrations.AddField(
            model_name='summary',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='comments',
            name='article',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='summaries.Summary'),
        ),
        migrations.AddField(
            model_name='comments',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AlterUniqueTogether(
            name='summary',
            unique_together={('user', 'title')},
        ),
    ]
