# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-11-30 15:56
from __future__ import unicode_literals

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='CommentNews',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateTimeField(auto_now=True, verbose_name='Дата')),
                ('comment', models.TextField(max_length=255, verbose_name='Оставить комментарий')),
            ],
            options={
                'verbose_name_plural': 'Комментарии',
                'verbose_name': 'Комментарий',
            },
        ),
        migrations.CreateModel(
            name='News',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateTimeField(auto_now=True, verbose_name='Дата')),
                ('title', models.CharField(max_length=255, verbose_name='Заголовок')),
                ('text', models.TextField(max_length=255, verbose_name='Текст')),
                ('image', models.ImageField(blank=True, upload_to='image', verbose_name='Изображение')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='Пользователь')),
            ],
            options={
                'verbose_name_plural': 'Новости',
                'ordering': ('-date',),
                'verbose_name': 'Новость',
            },
        ),
        migrations.AddField(
            model_name='commentnews',
            name='news',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='userblog.News', verbose_name='Новость'),
        ),
        migrations.AddField(
            model_name='commentnews',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='Пользователь'),
        ),
    ]
