# Generated by Django 3.0.3 on 2020-08-07 17:49

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0011_update_proxy_permissions'),
    ]

    operations = [
        migrations.CreateModel(
            name='BusCompany',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='PassengerAccount',
            fields=[
                ('id', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
                ('firstname', models.CharField(max_length=50)),
                ('lastname', models.CharField(max_length=50)),
                ('age', models.IntegerField()),
                ('birthday', models.DateField()),
                ('contact_no', models.CharField(max_length=13, validators=[django.core.validators.RegexValidator(message='Enter a valid Phone Number', regex='^(\\+639|09)\\d{9}$')])),
                ('address', models.CharField(blank=True, max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Schedule',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('schedule', models.DateTimeField()),
                ('origin', models.CharField(max_length=50)),
                ('destination', models.CharField(max_length=50)),
                ('ticket_price', models.DecimalField(decimal_places=2, max_digits=6)),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='home.BusCompany')),
            ],
        ),
        migrations.CreateModel(
            name='Reservation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('passenger', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='home.PassengerAccount')),
                ('schedule', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='home.Schedule')),
            ],
        ),
        migrations.CreateModel(
            name='Payment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('amount', models.DecimalField(decimal_places=2, max_digits=6)),
                ('payment', models.CharField(max_length=50)),
                ('status', models.CharField(max_length=50)),
                ('checkout_id', models.CharField(max_length=50)),
                ('reservation', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='home.Reservation')),
            ],
        ),
        migrations.CreateModel(
            name='CompanyAccount',
            fields=[
                ('id', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
                ('firstname', models.CharField(max_length=50)),
                ('lastname', models.CharField(max_length=50)),
                ('contact_no', models.CharField(max_length=13, validators=[django.core.validators.RegexValidator(message='Enter a valid Phone Number', regex='^(\\+639|09)\\d{9}$')])),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='home.BusCompany')),
            ],
        ),
    ]
