# Generated by Django 3.1.7 on 2021-03-16 06:44

import blog.models
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('users', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Author',
            fields=[
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='users.user')),
                ('profile_picture', models.ImageField(upload_to='')),
                ('name', models.CharField(blank=True, db_index=True, max_length=200, null=True, verbose_name='name')),
            ],
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=64, unique=True, verbose_name='Тема материала')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('title', models.CharField(db_index=True, max_length=256, verbose_name='Заголовок поста')),
                ('image', models.ImageField(blank=True, max_length=1024, null=True, upload_to=blog.models.upload_to_images, verbose_name='Изображение поста')),
                ('text', models.TextField(blank=True, null=True, verbose_name='Текст поста')),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='blog.author')),
                ('categories', models.ManyToManyField(to='blog.Category')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
