Commit d44dc515 authored by Alia Lawraine Olay's avatar Alia Lawraine Olay

Added migrations folder

parent 09968deb
# Generated by Django 4.0.4 on 2022-12-01 04:23
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='Additional_Item',
fields=[
('Description', models.CharField(max_length=50, primary_key=True, serialize=False, unique=True)),
('Item_Cost', models.IntegerField(default=0)),
],
),
migrations.CreateModel(
name='City',
fields=[
('Airport_Code', models.AutoField(editable=False, primary_key=True, serialize=False, unique=True)),
('Airport_name', models.CharField(max_length=50)),
('City_Name', models.CharField(max_length=50)),
('Country', models.CharField(max_length=50)),
],
),
migrations.CreateModel(
name='Crew_Member',
fields=[
('Employee_ID', models.AutoField(editable=False, primary_key=True, serialize=False, unique=True)),
('First_Name', models.CharField(max_length=50)),
('Last_Name', models.CharField(max_length=50)),
('Role', models.CharField(choices=[('Pilot', 'Pilot'), ('Flight Attendant', 'Flight Attendant')], max_length=50)),
],
),
migrations.CreateModel(
name='Flight',
fields=[
('Flight_ID', models.AutoField(editable=False, primary_key=True, serialize=False, unique=True)),
('Flight_Code', models.CharField(max_length=6)),
('Destination_Airport', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='destination', to='booking.city')),
('Origin_Airport', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='origin', to='booking.city')),
],
),
migrations.CreateModel(
name='Passenger',
fields=[
('P_ID', models.AutoField(editable=False, primary_key=True, serialize=False, unique=True)),
('First_Name', models.CharField(max_length=50)),
('Middle_Initial', models.CharField(blank=True, max_length=50)),
('Last_Name', models.CharField(max_length=50)),
('Birthdate', models.DateField(blank=True, null=True)),
('Age', models.CharField(max_length=3)),
('Gender', models.CharField(choices=[('Male', 'Male'), ('Female', 'Female'), ('Prefer not to say', 'Prefer not to say')], default='Prefer not to say', max_length=20)),
('Phone_num', models.CharField(max_length=11, validators=[django.core.validators.RegexValidator('^[0-9]*$', message='Please input numbers only')])),
('Email_add', models.EmailField(max_length=254, validators=[django.core.validators.EmailValidator()])),
],
),
migrations.CreateModel(
name='Flight_Attendant',
fields=[
('Employee_ID', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='booking.crew_member')),
('Assigned_Class', models.CharField(choices=[('Economy', 'Economy'), ('Premium Economy', 'Premium Economy'), ('Business', 'Business'), ('First Class', 'First Class')], max_length=50)),
],
),
migrations.CreateModel(
name='Pilot',
fields=[
('Employee_ID', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='booking.crew_member')),
('Rank', models.CharField(choices=[('Cadet Pilot', 'Cadet Pilot'), ('Second Officer', 'Second Officer'), ('First Officer', 'First Officer'), ('Senior First Officer', 'Senior First Officer'), ('Captain', 'Captain')], max_length=50)),
],
),
migrations.CreateModel(
name='Schedule',
fields=[
('Sched_Code', models.AutoField(editable=False, primary_key=True, serialize=False, unique=True)),
('Flight_Date', models.DateField(blank=True, null=True)),
('Departure_Time', models.TimeField(blank=True, null=True)),
('Arrival_Time', models.TimeField(blank=True, null=True)),
('Duration', models.CharField(max_length=50)),
('Flight_Cost', models.CharField(max_length=50)),
('Flight_Code', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='booking.flight')),
],
),
migrations.CreateModel(
name='Booking',
fields=[
('Booking_ID', models.AutoField(editable=False, primary_key=True, serialize=False, unique=True)),
('Booking_Date', models.DateField(blank=True, null=True)),
('Total_Cost', models.IntegerField(blank=True, default=0)),
('Passenger', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='booking.passenger')),
],
),
migrations.CreateModel(
name='Sched_Crew',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('Employee_ID', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='booking.crew_member')),
('Sched_Code', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='booking.schedule')),
],
options={
'unique_together': {('Sched_Code', 'Employee_ID')},
},
),
migrations.CreateModel(
name='Booking_Sched',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('Booking_ID', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='booking.booking')),
('Sched_Code', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='booking.schedule')),
],
options={
'unique_together': {('Booking_ID', 'Sched_Code')},
},
),
migrations.CreateModel(
name='Booking_AddItem',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('Quantity', models.IntegerField(default=0)),
('AddItem_Desc', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='booking.additional_item')),
('Booking_ID', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='booking.booking')),
],
options={
'unique_together': {('Booking_ID', 'AddItem_Desc')},
},
),
]
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment