# Generated by Django 2.2 on 2020-03-12 17:34

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


class Migration(migrations.Migration):

    dependencies = [
        ('airtrans', '0003_auto_20200312_1555'),
    ]

    operations = [
        migrations.CreateModel(
            name='Aircraft',
            fields=[
                ('aircraft_code', models.PositiveIntegerField(primary_key=True, serialize=False)),
                ('model', models.CharField(max_length=100)),
                ('range', models.PositiveIntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='Flight',
            fields=[
                ('flight_id', models.PositiveIntegerField(primary_key=True, serialize=False)),
                ('flight_no', models.PositiveIntegerField()),
                ('scheduled_departure', models.TimeField()),
                ('scheduled_arrival', models.TimeField()),
                ('status', models.TextField()),
                ('actual_departure', models.TimeField()),
                ('actual_arrival', models.TimeField()),
                ('aircraft_code', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='airtrans.Aircraft')),
            ],
        ),
        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=3)),
                ('fare_conditions', models.CharField(max_length=250)),
                ('aircraft_code', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='airtrans.Aircraft')),
            ],
        ),
        migrations.CreateModel(
            name='Ticket',
            fields=[
                ('tickets_no', models.AutoField(primary_key=True, serialize=False)),
                ('passenger_id', models.PositiveIntegerField()),
                ('passenger_name', models.CharField(max_length=250)),
                ('contact_data', models.CharField(max_length=250)),
                ('book_ref', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='airtrans.Booking')),
            ],
        ),
        migrations.AlterField(
            model_name='airport',
            name='airport_code',
            field=models.AutoField(primary_key=True, serialize=False),
        ),
        migrations.CreateModel(
            name='TicketFlight',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('amount', models.PositiveIntegerField()),
                ('fare_conditions', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='airtrans.Seat')),
                ('flight_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='airtrans.Flight')),
                ('ticket_no', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='airtrans.Ticket')),
            ],
            options={
                'unique_together': {('ticket_no', 'flight_id')},
            },
        ),
        migrations.AddField(
            model_name='flight',
            name='arrival_airport',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='arrival_airport', to='airtrans.Airport'),
        ),
        migrations.AddField(
            model_name='flight',
            name='departure_airport',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='departure_airport', to='airtrans.Airport'),
        ),
        migrations.CreateModel(
            name='BoardingPasses',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('boarding_no', models.PositiveIntegerField()),
                ('flight_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='flight_id1', to='airtrans.TicketFlight')),
                ('seat_no', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='airtrans.Seat')),
                ('ticket_no', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ticket_no1', to='airtrans.TicketFlight')),
            ],
            options={
                'unique_together': {('ticket_no', 'flight_id')},
            },
        ),
    ]
