# Generated by Django 3.0.5 on 2020-04-08 18:14

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


class Migration(migrations.Migration):

    dependencies = [
        ('airtransportproject', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Aircraft',
            fields=[
                ('aircraft_code', models.CharField(max_length=3, primary_key=True, serialize=False)),
                ('model_aircraft', models.CharField(max_length=100)),
                ('distance', models.PositiveIntegerField(default=1000)),
            ],
        ),
        migrations.CreateModel(
            name='Airport',
            fields=[
                ('airport_code', models.CharField(max_length=5, primary_key=True, serialize=False)),
                ('airport_name', models.TextField()),
                ('city', models.TextField()),
                ('coordinates', models.CharField(max_length=30, null=True)),
                ('timezone', models.CharField(choices=[('ACST ', 'UTC+9:30'), ('AEST ', 'UTC+10'), ('AKT ', 'UTC−9'), ('ART ', 'UTC-3'), ('AST ', 'UTC-4'), ('AWST ', 'UTC+8'), ('BDT ', 'UTC+6'), ('BTT ', 'UTC+6'), ('CAT ', 'UTC+2'), ('CET ', 'UTC+1'), ('CST ', 'UTC−6'), ('CXT ', 'UTC+7'), ('ChT ', 'UTC−4'), ('EAT ', 'UTC+3'), ('EET ', 'UTC+2'), ('EST ', 'UTC−5'), ('FET ', 'UTC+3'), ('GALT ', 'UTC+6'), ('GMT ', 'UTC'), ('HAST ', 'UTC−10'), ('HKT ', 'UTC+8'), ('IRST ', 'UTC+3:30'), ('IST ', 'UTC+2'), ('IST ', 'UTC+5:30'), ('JST ', 'UTC+9'), ('MT ', 'UTC−7'), ('MSK ', 'UTC+3'), ('MST ', 'UTC+6:30'), ('NFT ', 'UTC+11'), ('NST ', 'UTC-3:30'), ('PET ', 'UTC-5'), ('PHT ', 'UTC+8'), ('PKT ', 'UTC+5'), ('PMST ', 'UTC-3'), ('PST ', 'UTC-8'), ('SLT ', 'UTC+5:30'), ('SST ', 'UTC+8'), ('ST ', 'UTC−11'), ('THA ', 'UTC+7'), ('UTC ', 'UTC'), ('WAT ', 'UTC+1'), ('WET ', 'UTC')], default='UTC', max_length=5)),
            ],
        ),
        migrations.CreateModel(
            name='Flight',
            fields=[
                ('flight_id', models.CharField(max_length=100, primary_key=True, serialize=False)),
                ('flight_no', models.CharField(max_length=10)),
                ('scheduled_departure', models.DateTimeField()),
                ('scheduled_arrival', models.DateTimeField()),
                ('status', models.CharField(choices=[('SCHED', 'Scheduled'), ('TIME', 'On Time'), ('DELA', 'Delayed'), ('DEPAR', 'Departed'), ('ARR', 'Arrived'), ('CANC', 'Cancelled')], default='Scheduled', max_length=10)),
                ('actual_departure', models.DateTimeField()),
                ('actual_arrival', models.DateTimeField()),
                ('aircraft_code', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='airtransportproject.Aircraft')),
                ('arrival_airport', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='arrival', to='airtransportproject.Airport')),
                ('departure_airport', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='departure', to='airtransportproject.Airport')),
            ],
            options={
                'unique_together': {('flight_no', 'scheduled_departure')},
            },
        ),
        migrations.CreateModel(
            name='Ticket',
            fields=[
                ('ticket_no', models.CharField(max_length=13, primary_key=True, serialize=False)),
                ('passenger_id', models.CharField(max_length=20)),
                ('passenger_name', models.TextField(max_length=100)),
                ('contact_data', models.CharField(max_length=100)),
            ],
        ),
        migrations.AlterField(
            model_name='booking',
            name='book_date',
            field=models.DateField(auto_now=True),
        ),
        migrations.AlterField(
            model_name='booking',
            name='book_ref',
            field=models.CharField(max_length=6, primary_key=True, serialize=False),
        ),
        migrations.CreateModel(
            name='TicketFlight',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('fare_conditions', models.CharField(choices=[('ECON', 'Economy'), ('COMF', 'Comfort'), ('BUSI', 'Business')], default='Economy', max_length=10)),
                ('amount', models.FloatField()),
                ('flight_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='airtransportproject.Flight')),
                ('ticket_no', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='airtransportproject.Ticket')),
            ],
            options={
                'unique_together': {('ticket_no', 'flight_id')},
            },
        ),
        migrations.AddField(
            model_name='ticket',
            name='book_ref',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='airtransportproject.Booking'),
        ),
        migrations.CreateModel(
            name='Seat',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('seat_no', models.CharField(max_length=100)),
                ('fare_conditions', models.CharField(choices=[('ECON', 'Economy'), ('COMF', 'Comfort'), ('BUSI', 'Business')], default='Economy', max_length=10)),
                ('aircraft_code', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='airtransportproject.Aircraft')),
            ],
            options={
                'unique_together': {('seat_no', 'aircraft_code')},
            },
        ),
        migrations.CreateModel(
            name='BoardingPass',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('boarding_no', models.PositiveIntegerField()),
                ('seat_no', models.CharField(max_length=5)),
                ('flight_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='idFlight', to='airtransportproject.TicketFlight')),
                ('ticket_no', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='idTicket', to='airtransportproject.TicketFlight')),
            ],
            options={
                'unique_together': {('ticket_no', 'flight_id'), ('flight_id', 'seat_no')},
            },
        ),
    ]
