# Generated by Django 3.2.18 on 2023-03-01 09:48
from django.conf import settings
from django.contrib.auth import get_user_model
from django.db import migrations, models
import django.db.models.deletion

def create_verification_code_model(apps, schema_editor):
    """Создание модели верификационного кода,
    привязанного к использующейся в проекте модели пользователя"""

    # User = apps.get_model("users", "User")
    # User = get_user_model()
    migrations.CreateModel(
        name='VerificationCode',
        fields=[
            ('user',
             models.OneToOneField(on_delete=django.db.models.deletion.CASCADE,
                                  primary_key=True, serialize=False,
                                  to=settings.AUTH_USER_MODEL)),
            ('code', models.PositiveIntegerField()),
        ],
    ),


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_name_max_length'),
    ]

    operations = [
        # migrations.RunPython(create_verification_code_model),
        migrations.CreateModel(
            name='VerificationCode',
            fields=[
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
                ('code', models.PositiveIntegerField()),
            ],
        ),
    ]
