# Generated by Django 3.1.2 on 2021-05-26 03:34

from django.conf import settings
import django.contrib.auth.models
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_name_max_length'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='bus_model',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('marka', models.CharField(default=None, max_length=256, verbose_name='Марка')),
                ('gos_number', models.CharField(default=None, max_length=256, verbose_name='Гос номер')),
                ('row_count', models.IntegerField(default=0, verbose_name='Число рядов')),
                ('col_count', models.IntegerField(default=0, verbose_name='Число мест в ряду')),
                ('is_delete', models.BooleanField(default=True, verbose_name='Активен')),
            ],
            options={
                'verbose_name': 'Автобус',
                'verbose_name_plural': 'Автобусы',
                'db_table': 'bus_model',
            },
        ),
        migrations.CreateModel(
            name='flight_model',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date_start', models.DateTimeField(default=None, verbose_name='Дата отправления')),
                ('date_finish', models.DateTimeField(default=None, verbose_name='Дата прибытия')),
                ('price', models.FloatField(default=0, verbose_name='Цена')),
                ('is_delete', models.BooleanField(default=True, verbose_name='Активен')),
                ('bus_id', models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to='mainapp.bus_model', verbose_name='Автобус')),
            ],
            options={
                'verbose_name': 'Рейс',
                'verbose_name_plural': 'Рейсы',
                'db_table': 'flight_model',
            },
        ),
        migrations.CreateModel(
            name='station_model',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(default=None, max_length=256, verbose_name='Станция')),
                ('is_delete', models.BooleanField(default=True, verbose_name='Активен')),
            ],
            options={
                'verbose_name': 'Станция',
                'verbose_name_plural': 'Станции',
                'db_table': 'station_model',
            },
        ),
        migrations.CreateModel(
            name='UserFullName',
            fields=[
            ],
            options={
                'ordering': ['last_name', 'first_name'],
                'proxy': True,
                'indexes': [],
                'constraints': [],
            },
            bases=('auth.user',),
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='ticket_model',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('place', models.IntegerField(default=0, verbose_name='Место')),
                ('buy_time', models.DateTimeField(auto_now=True, verbose_name='Время покупки')),
                ('is_buy', models.BooleanField(default=False, verbose_name='Статус покупки')),
                ('is_pay', models.BooleanField(default=False, verbose_name='Статус оплаты')),
                ('client_last_name', models.CharField(default=None, max_length=256, verbose_name='Фамилия клиента')),
                ('client_first_name', models.CharField(default=None, max_length=256, verbose_name='Имя клиента')),
                ('client_patronymic_name', models.CharField(default=None, max_length=256, verbose_name='Отчесво клиента')),
                ('client_birthday', models.DateField(default=None, verbose_name='Дата рождения клиента')),
                ('client_doc_series', models.CharField(default=None, max_length=32, verbose_name='Серия документа')),
                ('client_doc_number', models.CharField(default=None, max_length=32, verbose_name='Номер документа')),
                ('is_delete', models.BooleanField(default=True, verbose_name='Активен')),
                ('cashier_id', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='cashiers', to=settings.AUTH_USER_MODEL, verbose_name='Кассир')),
                ('flight_id', models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to='mainapp.flight_model', verbose_name='Рейс')),
            ],
            options={
                'verbose_name': 'Билет',
                'verbose_name_plural': 'Билеты',
                'db_table': 'ticket_model',
            },
        ),
        migrations.AddField(
            model_name='flight_model',
            name='finish_id',
            field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, related_name='station_finish', to='mainapp.station_model', verbose_name='Станция прибытия'),
        ),
        migrations.AddField(
            model_name='flight_model',
            name='start_id',
            field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, related_name='station_start', to='mainapp.station_model', verbose_name='Станция отправления'),
        ),
        migrations.AddField(
            model_name='flight_model',
            name='voditel_id',
            field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, related_name='voditels', to=settings.AUTH_USER_MODEL, verbose_name='Водитель'),
        ),
        migrations.CreateModel(
            name='bus_FullName',
            fields=[
            ],
            options={
                'ordering': ['marka'],
                'proxy': True,
                'indexes': [],
                'constraints': [],
            },
            bases=('mainapp.bus_model',),
        ),
    ]
