# Generated by Django 5.0.6 on 2024-06-05 22:43

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Agency',
            fields=[
                ('agency_id', models.CharField(max_length=255, primary_key=True, serialize=False)),
                ('agency_name', models.CharField(max_length=255)),
                ('agency_url', models.URLField()),
                ('agency_timezone', models.CharField(max_length=255)),
                ('agency_lang', models.CharField(blank=True, max_length=2, null=True)),
                ('agency_phone', models.CharField(blank=True, max_length=50, null=True)),
                ('agency_fare_url', models.URLField(blank=True, null=True)),
                ('agency_email', models.EmailField(blank=True, max_length=254, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Area',
            fields=[
                ('area_id', models.CharField(max_length=255, primary_key=True, serialize=False)),
                ('area_name', models.CharField(max_length=255)),
                ('area_description', models.TextField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Calendar',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('service_id', models.IntegerField()),
                ('monday', models.BooleanField()),
                ('tuesday', models.BooleanField()),
                ('wednesday', models.BooleanField()),
                ('thursday', models.BooleanField()),
                ('friday', models.BooleanField()),
                ('saturday', models.BooleanField()),
                ('sunday', models.BooleanField()),
                ('start_date', models.DateField()),
                ('end_date', models.DateField()),
            ],
        ),
        migrations.CreateModel(
            name='FareMedium',
            fields=[
                ('fare_media_id', models.CharField(max_length=255, primary_key=True, serialize=False)),
                ('fare_media_name', models.CharField(max_length=255)),
                ('fare_media_description', models.TextField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='FareProduct',
            fields=[
                ('fare_product_id', models.BigAutoField(primary_key=True, serialize=False)),
                ('fare_product_name', models.CharField(max_length=255)),
                ('fare_product_description', models.TextField(blank=True, null=True)),
                ('amount', models.FloatField()),
                ('curreny', models.CharField(max_length=64)),
            ],
        ),
        migrations.CreateModel(
            name='FeedInfo',
            fields=[
                ('feed_publisher_name', models.CharField(max_length=255)),
                ('feed_publisher_url', models.URLField()),
                ('feed_lang', models.CharField(max_length=255)),
                ('default_lang', models.CharField(blank=True, max_length=255, null=True)),
                ('feed_start_date', models.DateField(blank=True, null=True)),
                ('feed_end_date', models.DateField(blank=True, null=True)),
                ('feed_version', models.CharField(blank=True, max_length=255, null=True)),
                ('feed_contact_email', models.EmailField(blank=True, max_length=254, null=True)),
                ('feed_contact_url', models.URLField(blank=True, null=True)),
                ('feed_id', models.BigAutoField(primary_key=True, serialize=False)),
            ],
        ),
        migrations.CreateModel(
            name='Level',
            fields=[
                ('level_id', models.CharField(max_length=255, primary_key=True, serialize=False)),
                ('level_index', models.FloatField()),
                ('level_name', models.CharField(blank=True, max_length=255, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='LocationGroup',
            fields=[
                ('location_group_id', models.CharField(max_length=255, primary_key=True, serialize=False)),
                ('location_group_name', models.CharField(max_length=255)),
                ('location_group_type', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='LocationsGeojson',
            fields=[
                ('location_id', models.CharField(max_length=255, primary_key=True, serialize=False)),
                ('location_name', models.CharField(max_length=255)),
                ('location_lat', models.FloatField()),
                ('location_lon', models.FloatField()),
                ('location_type', models.CharField(max_length=255)),
                ('parent_location_id', models.CharField(blank=True, max_length=255, null=True)),
                ('wheelchair_boarding', models.BooleanField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Network',
            fields=[
                ('network_id', models.CharField(max_length=255, primary_key=True, serialize=False)),
                ('network_name', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='Timeframe',
            fields=[
                ('timeframe_group_id', models.IntegerField(primary_key=True, serialize=False)),
                ('service_id', models.IntegerField()),
                ('start_date', models.DateField()),
                ('end_date', models.DateField()),
                ('start_time', models.TimeField()),
                ('end_time', models.TimeField()),
            ],
        ),
        migrations.CreateModel(
            name='Translation',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('table_name', models.CharField(max_length=255)),
                ('field_name', models.CharField(max_length=255)),
                ('language', models.CharField(max_length=2)),
                ('translation', models.TextField()),
            ],
        ),
        migrations.CreateModel(
            name='CalendarDate',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('service_id', models.IntegerField()),
                ('date', models.DateField()),
                ('exception_type', models.IntegerField()),
            ],
            options={
                'unique_together': {('service_id', 'date')},
            },
        ),
        migrations.CreateModel(
            name='FareAttribute',
            fields=[
                ('fare_id', models.CharField(max_length=255, primary_key=True, serialize=False)),
                ('price', models.FloatField()),
                ('currency_type', models.CharField(max_length=3)),
                ('payment_method', models.IntegerField()),
                ('transfers', models.IntegerField()),
                ('transfer_duration', models.IntegerField(blank=True, null=True)),
                ('agency', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='pt_map.agency')),
            ],
        ),
        migrations.CreateModel(
            name='FareTransferRule',
            fields=[
                ('fare_transfer_rule_id', models.CharField(max_length=255, primary_key=True, serialize=False)),
                ('fare_transfer_rule_name', models.CharField(max_length=255)),
                ('fare_transfer_rule_description', models.TextField(blank=True, null=True)),
                ('from_leg_group_id', models.IntegerField(blank=True, null=True)),
                ('to_leg_group_id', models.IntegerField(blank=True, null=True)),
                ('fare_product_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='pt_map.fareproduct')),
            ],
        ),
        migrations.CreateModel(
            name='Route',
            fields=[
                ('route_id', models.IntegerField(primary_key=True, serialize=False)),
                ('route_short_name', models.CharField(max_length=50)),
                ('route_long_name', models.CharField(blank=True, max_length=255, null=True)),
                ('route_desc', models.TextField(blank=True, null=True)),
                ('route_type', models.IntegerField(default=0)),
                ('route_url', models.URLField(blank=True, null=True)),
                ('route_color', models.CharField(blank=True, max_length=6, null=True)),
                ('route_text_color', models.CharField(blank=True, max_length=6, null=True)),
                ('route_sort_order', models.IntegerField(blank=True, null=True)),
                ('continuous_pickup', models.IntegerField(blank=True, null=True)),
                ('continuous_drop_off', models.IntegerField(blank=True, null=True)),
                ('agency_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='pt_map.agency')),
            ],
        ),
        migrations.CreateModel(
            name='FareRule',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('origin_id', models.IntegerField(blank=True, null=True)),
                ('destination_id', models.CharField(blank=True, max_length=255, null=True)),
                ('contains_id', models.CharField(blank=True, max_length=255, null=True)),
                ('fare', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pt_map.fareattribute')),
                ('route', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='pt_map.route')),
            ],
        ),
        migrations.CreateModel(
            name='RouteNetwork',
            fields=[
                ('route_network_id', models.CharField(max_length=255, primary_key=True, serialize=False)),
                ('route_network_name', models.CharField(max_length=255)),
                ('network_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pt_map.network')),
                ('route_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pt_map.route')),
            ],
        ),
        migrations.CreateModel(
            name='Shape',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('shape_id', models.CharField(max_length=255)),
                ('shape_pt_lat', models.FloatField()),
                ('shape_pt_lon', models.FloatField()),
                ('shape_pt_sequence', models.IntegerField()),
                ('shape_dist_traveled', models.FloatField(blank=True, null=True)),
            ],
            options={
                'unique_together': {('shape_id', 'shape_pt_sequence')},
            },
        ),
        migrations.CreateModel(
            name='Stop',
            fields=[
                ('stop_id', models.CharField(max_length=255, primary_key=True, serialize=False)),
                ('stop_code', models.CharField(blank=True, max_length=50, null=True)),
                ('stop_name', models.CharField(max_length=255)),
                ('stop_desc', models.TextField(blank=True, null=True)),
                ('stop_lat', models.FloatField()),
                ('stop_lon', models.FloatField()),
                ('zone_id', models.CharField(blank=True, max_length=255, null=True)),
                ('stop_url', models.URLField(blank=True, null=True)),
                ('location_type', models.IntegerField(blank=True, null=True)),
                ('stop_timezone', models.CharField(blank=True, max_length=255, null=True)),
                ('wheelchair_boarding', models.IntegerField(blank=True, null=True)),
                ('platform_code', models.CharField(blank=True, max_length=50, null=True)),
                ('level_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='pt_map.level')),
                ('parent_station', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='pt_map.stop')),
            ],
        ),
        migrations.CreateModel(
            name='Pathway',
            fields=[
                ('pathway_id', models.CharField(max_length=255, primary_key=True, serialize=False)),
                ('pathway_mode', models.IntegerField()),
                ('is_bidirectional', models.IntegerField()),
                ('length', models.FloatField(blank=True, null=True)),
                ('traversal_time', models.IntegerField(blank=True, null=True)),
                ('stair_count', models.IntegerField(blank=True, null=True)),
                ('max_slope', models.FloatField(blank=True, null=True)),
                ('min_width', models.FloatField(blank=True, null=True)),
                ('signposted_as', models.CharField(blank=True, max_length=255, null=True)),
                ('reversed_signposted_as', models.CharField(blank=True, max_length=255, null=True)),
                ('from_stop_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='pathways_from', to='pt_map.stop')),
                ('to_stop_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='pathways_to', to='pt_map.stop')),
            ],
        ),
        migrations.CreateModel(
            name='LocationGroupStop',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('location_group_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pt_map.locationgroup')),
                ('stop_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pt_map.stop')),
            ],
        ),
        migrations.CreateModel(
            name='StopArea',
            fields=[
                ('stop_area_id', models.CharField(max_length=255, primary_key=True, serialize=False)),
                ('stop_area_name', models.CharField(max_length=255)),
                ('stop_area_description', models.TextField(blank=True, null=True)),
                ('area_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pt_map.area')),
                ('stop_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pt_map.stop')),
            ],
        ),
        migrations.CreateModel(
            name='FareLegRule',
            fields=[
                ('fare_leg_rule_id', models.CharField(max_length=255, primary_key=True, serialize=False)),
                ('fare_leg_rule_name', models.CharField(max_length=255)),
                ('fare_leg_rule_description', models.TextField(blank=True, null=True)),
                ('from_area_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='farelegrule_from_area', to='pt_map.area')),
                ('to_area_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='farelegrule_to_area', to='pt_map.area')),
                ('fare_product_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pt_map.fareproduct')),
                ('network_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='pt_map.network')),
                ('from_timeframe_group_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='farelegrule_from_timeframe', to='pt_map.timeframe')),
                ('to_timeframe_group_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='farelegrule_to_timeframe', to='pt_map.timeframe')),
            ],
        ),
        migrations.CreateModel(
            name='Trip',
            fields=[
                ('trip_id', models.CharField(max_length=255, primary_key=True, serialize=False)),
                ('service_id', models.IntegerField()),
                ('trip_headsign', models.CharField(blank=True, max_length=255, null=True)),
                ('trip_short_name', models.CharField(blank=True, max_length=255, null=True)),
                ('direction_id', models.IntegerField(blank=True, null=True)),
                ('block_id', models.CharField(blank=True, max_length=255, null=True)),
                ('wheelchair_accessible', models.IntegerField(blank=True, null=True)),
                ('bikes_allowed', models.IntegerField(blank=True, null=True)),
                ('route_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pt_map.route')),
                ('shape_id', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, to='pt_map.shape')),
            ],
        ),
        migrations.CreateModel(
            name='Frequency',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('start_time', models.TimeField()),
                ('end_time', models.TimeField()),
                ('headway_secs', models.IntegerField()),
                ('exact_times', models.IntegerField(blank=True, null=True)),
                ('trip_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pt_map.trip')),
            ],
        ),
        migrations.CreateModel(
            name='BookingRule',
            fields=[
                ('booking_rule_id', models.CharField(max_length=255, primary_key=True, serialize=False)),
                ('start_time', models.TimeField(blank=True, null=True)),
                ('end_time', models.TimeField(blank=True, null=True)),
                ('booking_type', models.CharField(max_length=255)),
                ('rule_criteria', models.TextField(blank=True, null=True)),
                ('booking_rule_instructions', models.TextField(blank=True, null=True)),
                ('trip', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pt_map.trip')),
            ],
        ),
        migrations.CreateModel(
            name='Attribution',
            fields=[
                ('attribution_id', models.BigAutoField(primary_key=True, serialize=False)),
                ('attribution_name', models.CharField(max_length=255)),
                ('attribution_url', models.URLField()),
                ('attribution_email', models.EmailField(blank=True, max_length=254, null=True)),
                ('attribution_phone', models.CharField(blank=True, max_length=50, null=True)),
                ('agency_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='pt_map.agency')),
                ('route_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='pt_map.route')),
                ('trip_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='pt_map.trip')),
            ],
        ),
        migrations.CreateModel(
            name='Transfer',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('transfer_type', models.IntegerField()),
                ('min_transfer_time', models.IntegerField(blank=True, null=True)),
                ('from_route_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='transfers_from_route', to='pt_map.route')),
                ('from_stop', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='transfers_from_stop', to='pt_map.stop')),
                ('to_route_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='transfers_to_route', to='pt_map.route')),
                ('to_stop', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='transfers_to_stop', to='pt_map.stop')),
                ('from_trip_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='transfers_from_trip', to='pt_map.trip')),
                ('to_trip_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='transfers_to_trip', to='pt_map.trip')),
            ],
            options={
                'unique_together': {('from_stop', 'to_stop')},
            },
        ),
        migrations.CreateModel(
            name='StopTime',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('arrival_time', models.TimeField(blank=True, null=True)),
                ('departure_time', models.TimeField(blank=True, null=True)),
                ('stop_sequence', models.IntegerField()),
                ('stop_headsign', models.CharField(blank=True, max_length=255, null=True)),
                ('pickup_type', models.IntegerField(blank=True, null=True)),
                ('drop_off_type', models.IntegerField(blank=True, null=True)),
                ('shape_dist_traveled', models.FloatField(blank=True, null=True)),
                ('timepoint', models.IntegerField(blank=True, null=True)),
                ('location_group_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='pt_map.locationgroup')),
                ('location_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='pt_map.locationsgeojson')),
                ('stop_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pt_map.stop')),
                ('trip_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pt_map.trip')),
            ],
            options={
                'unique_together': {('trip_id', 'stop_sequence')},
            },
        ),
    ]
