# Generated by Django 4.2.11 on 2024-03-23 20:11

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import phonenumber_field.modelfields


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Department',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Создано')),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='Изменено')),
                ('name', models.CharField(max_length=64, unique=True, verbose_name='Название')),
                ('comment', models.CharField(blank=True, max_length=256, verbose_name='Комментарий')),
            ],
            options={
                'verbose_name': 'Подразделение',
                'verbose_name_plural': 'Подразделения',
            },
        ),
        migrations.CreateModel(
            name='UserExt',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Создано')),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='Изменено')),
                ('phonenumber', phonenumber_field.modelfields.PhoneNumberField(max_length=128, region=None, unique=True, verbose_name='Номер телефона')),
                ('ip', models.GenericIPAddressField()),
                ('http_referer', models.URLField(blank=True, max_length=2048, verbose_name='Реф. ссылка')),
                ('department', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='Подразделение', to='ext.department')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, related_name='Пользователь', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Расширение пользователя',
                'verbose_name_plural': 'Расширение пользователей',
            },
        ),
    ]
