# Generated by Django 4.2 on 2024-04-09 16:07

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import users.models


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name="Profile",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "birthday",
                    models.DateField(
                        blank=True,
                        null=True,
                        verbose_name="Дата рождения пользователя",
                    ),
                ),
                (
                    "role",
                    models.CharField(
                        max_length=20, verbose_name="Роль пользователя"
                    ),
                ),
                (
                    "image",
                    models.ImageField(
                        blank=True,
                        null=True,
                        upload_to=users.models.Profile.get_upload_path,
                        verbose_name="Аватар пользователя",
                    ),
                ),
                (
                    "user",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="profile",
                        related_query_name="profile",
                        to=settings.AUTH_USER_MODEL,
                        verbose_name="Пользователь",
                    ),
                ),
            ],
            options={
                "verbose_name": "Данные пользователя",
                "verbose_name_plural": "Данные пользователей",
                "db_table": "users_profiles",
            },
        ),
    ]
