# Generated by Django 2.2.7 on 2019-12-02 17:03

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import utils.mixins


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='City',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=20, unique=True)),
                ('lat', models.FloatField()),
                ('lon', models.FloatField()),
            ],
            options={
                'verbose_name_plural': 'cities',
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='Comfort',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('comfort_type', models.CharField(choices=[('ЭК', 'Эконом'), ('КМФ', 'Комфорт'), ('БИЗ', 'Бизнес'), ('ПКЛ', 'Первый класс')], default='', max_length=3)),
            ],
            options={
                'verbose_name_plural': 'comfort_types',
                'ordering': ['pk'],
            },
        ),
        migrations.CreateModel(
            name='Passenger',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('surname', models.CharField(max_length=20)),
                ('name', models.CharField(max_length=20)),
                ('patronymic', models.CharField(max_length=20)),
                ('phone', models.PositiveIntegerField(max_length=13, unique=True)),
                ('passport_series', models.CharField(max_length=2)),
                ('passport_number', models.CharField(max_length=7, unique=True)),
                ('email', models.EmailField(max_length=254, unique=True)),
            ],
            options={
                'verbose_name_plural': 'passengers',
                'ordering': ['surname'],
            },
        ),
        migrations.CreateModel(
            name='Plane',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('plane_num', models.CharField(default='', max_length=5, unique=True)),
                ('plane_model', models.CharField(default='AirBus A319', max_length=20)),
                ('dep_time', models.TimeField()),
                ('arr_time', models.TimeField()),
                ('comfort_type', models.CharField(choices=[('ЭК', 'Эконом'), ('КМФ', 'Комфорт'), ('БИЗ', 'Бизнес'), ('ПКЛ', 'Первый класс')], default='', max_length=3)),
                ('arr_station', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='arrival_plane', to='booking.City')),
                ('dep_station', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='departure_plane', to='booking.City')),
                ('user', models.ForeignKey(default='3', on_delete=django.db.models.deletion.CASCADE, related_name='user_info', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name_plural': 'planes',
                'ordering': ['dep_station'],
            },
        ),
        migrations.CreateModel(
            name='Flight',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('booked_plane', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user_plane', to='booking.Plane')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user_flight', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name_plural': 'flights',
                'ordering': ['user'],
            },
            bases=(utils.mixins.StrReprMixin, models.Model),
        ),
    ]
