# Generated by Django 3.0.2 on 2020-01-17 19:33

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Address',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('address_1', models.CharField(max_length=250)),
                ('address_2', models.CharField(blank=True, max_length=250, null=True)),
                ('state', models.CharField(max_length=50)),
                ('city', models.CharField(max_length=50)),
                ('pincode', models.PositiveIntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='BusRoute',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('route', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='BusTimeTable',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('time', models.TimeField()),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('dob', models.DateField(blank=True, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('address', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='app.Address')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Bus',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('bus_name', models.CharField(max_length=50)),
                ('bus_no', models.PositiveIntegerField()),
                ('source', models.CharField(max_length=50)),
                ('destination', models.CharField(max_length=50)),
                ('arrivial_time', models.TimeField()),
                ('departure_time', models.TimeField()),
                ('fare', models.DecimalField(decimal_places=2, max_digits=8)),
                ('bus_route', models.ManyToManyField(to='app.BusRoute')),
            ],
        ),
        migrations.CreateModel(
            name='Booking',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.CharField(blank=True, choices=[('C', 'Canceled'), ('B', 'Booked'), ('W', 'Watting')], max_length=1, null=True)),
                ('fare_category', models.CharField(choices=[('C', 'Child'), ('A', 'Adult')], max_length=1)),
                ('fare', models.DecimalField(blank=True, decimal_places=2, default=0.0, max_digits=8, null=True)),
                ('pay_status', models.CharField(choices=[('P', 'Pending'), ('F', 'Failed'), ('S', 'Success')], max_length=1)),
                ('bus_id', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='app.Bus')),
                ('cust_id', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='app.Profile')),
            ],
        ),
    ]
