# Generated by Django 3.1.1 on 2020-09-12 01:48

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='Tag',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=30, verbose_name='Тег')),
                ('slug', models.SlugField(max_length=30, unique=True)),
            ],
            options={
                'verbose_name': 'Тег',
                'verbose_name_plural': 'Теги',
            },
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('editing_date', models.DateTimeField(auto_created=True, verbose_name='Дата редактирования')),
                ('creation_date', models.DateTimeField(auto_created=True, verbose_name='Дата создания')),
                ('title', models.CharField(max_length=30, verbose_name='Заголовок')),
                ('content', models.TextField(verbose_name='Содержимое')),
                ('slug', models.SlugField(unique=True)),
                ('published_date', models.DateTimeField(verbose_name='Дата публикации')),
                ('image', models.URLField(default='http://placehold.it/900x300', verbose_name='Фото')),
                ('tags', models.ManyToManyField(blank=True, related_name='posts', to='blog.Tag', verbose_name='Тег')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='Автор')),
            ],
            options={
                'verbose_name': 'Публикация',
                'verbose_name_plural': 'Публикации',
            },
        ),
    ]
