# Generated by Django 2.0.5 on 2018-06-14 23:40

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Crew',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('crew_id', models.CharField(max_length=15, verbose_name='Crew ID')),
            ],
        ),
        migrations.CreateModel(
            name='Flight',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('src', models.CharField(max_length=200, verbose_name='Source airport')),
                ('dest', models.CharField(max_length=200, verbose_name='Destination airport')),
                ('start', models.DateTimeField(verbose_name='Start date')),
                ('end', models.DateTimeField(verbose_name='Landing date')),
                ('crew', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='airlines.Crew')),
            ],
        ),
        migrations.CreateModel(
            name='Plane',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('reg_id', models.CharField(max_length=200, unique=True, verbose_name='Registration identificator')),
                ('seats_count', models.IntegerField(verbose_name='Seats')),
                ('service_start', models.DateTimeField(verbose_name='In service since')),
            ],
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('surname', models.CharField(max_length=100, verbose_name='Surname')),
                ('name', models.CharField(max_length=100, verbose_name='Name')),
                ('flights', models.ManyToManyField(blank=True, to='airlines.Flight')),
            ],
        ),
        migrations.CreateModel(
            name='Worker',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('surname', models.CharField(max_length=100, verbose_name='Surname')),
                ('name', models.CharField(max_length=100, verbose_name='Name')),
                ('crew', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='airlines.Crew')),
            ],
        ),
        migrations.AddField(
            model_name='flight',
            name='plane',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='airlines.Plane'),
        ),
        migrations.AddField(
            model_name='flight',
            name='tickets',
            field=models.ManyToManyField(blank=True, to='airlines.User'),
        ),
        migrations.AlterUniqueTogether(
            name='worker',
            unique_together={('surname', 'name')},
        ),
        migrations.AlterUniqueTogether(
            name='user',
            unique_together={('surname', 'name')},
        ),
    ]
