# Generated by Django 3.2.5 on 2021-08-04 13:58

from django.conf import settings
import django.contrib.auth.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import simple_history.models


class Migration(migrations.Migration):

    dependencies = [
        ('users', '0008_user_device_platform'),
    ]

    operations = [
        migrations.CreateModel(
            name='HistoricalUser',
            fields=[
                ('id', models.BigIntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('username', models.CharField(db_index=True, error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
                ('first_name', models.CharField(blank=True, max_length=150, verbose_name='first name')),
                ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
                ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
                ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
                ('image', models.TextField(default='img/avatar.png', help_text='File size no more than 1Mb, image format - JPEG, PNG, GIF.', max_length=255, null=True, verbose_name='Image')),
                ('email', models.EmailField(blank=True, db_index=True, max_length=254, verbose_name='email address')),
                ('phone', models.CharField(help_text='Input format: 79601234567', max_length=11, null=True, verbose_name='Phone')),
                ('city', models.CharField(blank=True, max_length=100, null=True, verbose_name='City')),
                ('gender', models.CharField(choices=[('M', 'Male'), ('F', 'Female'), ('X', 'Not Available')], default='X', max_length=30, null=True, verbose_name='Gender')),
                ('address', models.TextField(blank=True, verbose_name='Address')),
                ('birth_date', models.DateField(blank=True, null=True, verbose_name='Birth date')),
                ('is_driver', models.BooleanField(default=False, verbose_name='Driver')),
                ('is_dispatcher', models.BooleanField(default=False, verbose_name='Dispatcher')),
                ('note', models.CharField(max_length=300, verbose_name='Note')),
                ('device_platform', models.CharField(blank=True, choices=[('ANDROID', 'Android'), ('IOS', 'iOS')], max_length=7, verbose_name='Device platform')),
                ('history_id', models.AutoField(primary_key=True, serialize=False)),
                ('history_date', models.DateTimeField()),
                ('history_change_reason', models.CharField(max_length=100, null=True)),
                ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
                ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'historical User',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
