# Generated by Django 3.2.6 on 2021-09-03 21:19

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


class Migration(migrations.Migration):
    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('slug', models.SlugField(max_length=255, unique=True)),
                ('body', models.TextField(verbose_name='main post text')),
                ('title', models.CharField(max_length=50, verbose_name='title describing the essence of the post')),
                ('created_date', models.DateTimeField(auto_now=True, verbose_name='date of post creation')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL,
                                           verbose_name='which user the post belongs to')),
            ],
            options={
                'verbose_name': 'post',
                'verbose_name_plural': 'Posts',
            },
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('text', models.TextField(verbose_name='main comment text')),
                ('created_date', models.DateTimeField(auto_now=True, verbose_name='date of comment creation')),
                ('deleted', models.BooleanField(default=False, verbose_name='has this comment been deleted?')),
                ('lft', models.PositiveIntegerField(editable=False)),
                ('rght', models.PositiveIntegerField(editable=False)),
                ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)),
                ('level', models.PositiveIntegerField(editable=False)),
                ('parent',
                 mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL,
                                            related_name='comment_children', to='posts.comment',
                                            verbose_name='parent comment which the comment belongs to')),
                ('post', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comments',
                                           to='posts.post', verbose_name='post the comment belongs to')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL,
                                           verbose_name='which user the post belongs to')),
            ],
            options={
                'verbose_name': 'comment',
                'verbose_name_plural': 'Comments',
            },
        ),
    ]
