# Generated by Django 3.2 on 2021-05-27 13:21

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='Human',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('first_name', models.CharField(blank=True, max_length=255, null=True, verbose_name='Имя')),
                ('last_name', models.CharField(blank=True, max_length=255, null=True, verbose_name='Фамилия')),
                ('image', models.ImageField(blank=True, null=True, upload_to='human_face', verbose_name='Изображение')),
                ('slug', models.SlugField(blank=True, default=None, null=True, verbose_name='Создаётся авт-ки')),
                ('date_of_birth', models.DateField(null=True, verbose_name='Дата рождения')),
                ('parents', models.ManyToManyField(blank=True, to='mainapp.Human', verbose_name='Родители')),
                ('user', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='Пользователь (если есть)')),
            ],
        ),
        migrations.CreateModel(
            name='Tree',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('slug', models.SlugField(blank=True, default=None, null=True, unique=True, verbose_name='Слаг (создаётся авт-ки)')),
                ('creator', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='creator', to=settings.AUTH_USER_MODEL, verbose_name='Создатель')),
                ('humans', models.ManyToManyField(related_name='trees', to='mainapp.Human', verbose_name='Люди')),
                ('oldest_human', models.OneToOneField(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='oldest_human', to='mainapp.human', verbose_name='Прародитель')),
                ('potential_user', models.ManyToManyField(blank=True, null=True, related_name='potential_trees', to=settings.AUTH_USER_MODEL, verbose_name='Ожидающие разрешения')),
                ('user', models.ManyToManyField(related_name='trees', to=settings.AUTH_USER_MODEL, verbose_name='Пользователь')),
            ],
        ),
        migrations.CreateModel(
            name='NumberChanges',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('number', models.IntegerField(verbose_name='Количество изменений')),
                ('tree', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tree', to='mainapp.tree', verbose_name='Дерево')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user', to=settings.AUTH_USER_MODEL, verbose_name='Пользователь')),
            ],
        ),
        migrations.CreateModel(
            name='Message',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('text', models.TextField(verbose_name='Содержание')),
                ('sending_time', models.DateTimeField(verbose_name='Время отправки')),
                ('check_read_it', models.BooleanField(default=False, verbose_name='Прочитано')),
                ('text_for_sender', models.TextField(default='', verbose_name='Текст сообщения для отправляющего')),
                ('recipient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='recipient', to=settings.AUTH_USER_MODEL, verbose_name='Получатель')),
                ('sender', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='sender', to=settings.AUTH_USER_MODEL, verbose_name='Отправитель')),
            ],
        ),
    ]
