# Generated by Django 2.0.4 on 2018-05-31 09:42

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Airport',
            fields=[
                ('name', models.CharField(max_length=100, primary_key=True, serialize=False)),
            ],
        ),
        migrations.CreateModel(
            name='Booking',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('tickets', models.IntegerField(validators=[django.core.validators.MinValueValidator(1)])),
            ],
        ),
        migrations.CreateModel(
            name='Employee',
            fields=[
                ('name', models.CharField(max_length=100, primary_key=True, serialize=False)),
                ('captainPermissions', models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name='Flight',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('departureDate', models.DateTimeField()),
                ('arrivalDate', models.DateTimeField()),
                ('arrivalAirport', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='destination', to='flights.Airport')),
                ('departureAirport', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='origin', to='flights.Airport')),
            ],
        ),
        migrations.CreateModel(
            name='Person',
            fields=[
                ('name', models.CharField(max_length=100, primary_key=True, serialize=False)),
            ],
        ),
        migrations.CreateModel(
            name='Plane',
            fields=[
                ('name', models.CharField(max_length=100, primary_key=True, serialize=False)),
                ('capacity', models.IntegerField(default=1, validators=[django.core.validators.MinValueValidator(1)])),
            ],
        ),
        migrations.CreateModel(
            name='Crew',
            fields=[
                ('captain', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='captain', serialize=False, to='flights.Employee')),
                ('members', models.ManyToManyField(to='flights.Employee')),
            ],
        ),
        migrations.AddField(
            model_name='flight',
            name='plane',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='flights.Plane'),
        ),
        migrations.AddField(
            model_name='booking',
            name='flight',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='flights.Flight'),
        ),
        migrations.AddField(
            model_name='booking',
            name='person',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='flights.Person'),
        ),
        migrations.AddField(
            model_name='flight',
            name='crew',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='flights.Crew'),
        ),
    ]
