trainvel/sncfgtfs/migrations/0001_initial.py

518 lines
18 KiB
Python

# Generated by Django 5.0.1 on 2024-01-26 20:15
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,
verbose_name="Agency ID",
),
),
(
"agency_name",
models.CharField(
max_length=255, unique=True, verbose_name="Agency name"
),
),
("agency_url", models.URLField(verbose_name="Agency URL")),
(
"agency_timezone",
models.CharField(max_length=255, verbose_name="Agency timezone"),
),
(
"agency_lang",
models.CharField(
blank=True, max_length=255, verbose_name="Agency language"
),
),
],
options={
"verbose_name": "Agency",
"verbose_name_plural": "Agencies",
},
),
migrations.CreateModel(
name="Calendar",
fields=[
(
"service_id",
models.CharField(
max_length=255,
primary_key=True,
serialize=False,
verbose_name="Service ID",
),
),
("monday", models.BooleanField(verbose_name="Monday")),
("tuesday", models.BooleanField(verbose_name="Tuesday")),
("wednesday", models.BooleanField(verbose_name="Wednesday")),
("thursday", models.BooleanField(verbose_name="Thursday")),
("friday", models.BooleanField(verbose_name="Friday")),
("saturday", models.BooleanField(verbose_name="Saturday")),
("sunday", models.BooleanField(verbose_name="Sunday")),
("start_date", models.DateField(verbose_name="Start date")),
("end_date", models.DateField(verbose_name="End date")),
],
options={
"verbose_name": "Calendar",
"verbose_name_plural": "Calendars",
},
),
migrations.CreateModel(
name="FeedInfo",
fields=[
(
"feed_id",
models.SmallIntegerField(
primary_key=True, serialize=False, verbose_name="Feed ID"
),
),
(
"feed_publisher_name",
models.CharField(
max_length=255, verbose_name="Feed publisher name"
),
),
(
"feed_publisher_url",
models.URLField(verbose_name="Feed publisher URL"),
),
(
"feed_lang",
models.CharField(max_length=255, verbose_name="Feed language"),
),
("feed_start_date", models.DateField(verbose_name="Feed start date")),
("feed_end_date", models.DateField(verbose_name="Feed end date")),
(
"feed_version",
models.CharField(max_length=255, verbose_name="Feed version"),
),
],
options={
"verbose_name": "Feed info",
"verbose_name_plural": "Feed infos",
},
),
migrations.CreateModel(
name="CalendarDate",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("date", models.DateField(verbose_name="Date")),
("exception_type", models.IntegerField(verbose_name="Exception type")),
(
"service_id",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="sncfgtfs.calendar",
verbose_name="Service ID",
),
),
],
options={
"verbose_name": "Calendar date",
"verbose_name_plural": "Calendar dates",
},
),
migrations.CreateModel(
name="Route",
fields=[
(
"route_id",
models.CharField(
max_length=255,
primary_key=True,
serialize=False,
verbose_name="Route ID",
),
),
(
"route_short_name",
models.CharField(max_length=255, verbose_name="Route short name"),
),
(
"route_long_name",
models.CharField(max_length=255, verbose_name="Route long name"),
),
(
"route_desc",
models.CharField(
blank=True, max_length=255, verbose_name="Route description"
),
),
(
"route_type",
models.IntegerField(
choices=[
(0, "Tram"),
(1, "Metro"),
(2, "Rail"),
(3, "Bus"),
(4, "Ferry"),
(5, "Cable car"),
(6, "Gondola"),
(7, "Funicular"),
],
verbose_name="Route type",
),
),
("route_url", models.URLField(blank=True, verbose_name="Route URL")),
(
"route_color",
models.CharField(
blank=True, max_length=255, verbose_name="Route color"
),
),
(
"route_text_color",
models.CharField(
blank=True, max_length=255, verbose_name="Route text color"
),
),
(
"agency",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="sncfgtfs.agency",
verbose_name="Agency ID",
),
),
],
options={
"verbose_name": "Route",
"verbose_name_plural": "Routes",
},
),
migrations.CreateModel(
name="Stop",
fields=[
(
"stop_id",
models.CharField(
max_length=255,
primary_key=True,
serialize=False,
verbose_name="Stop ID",
),
),
(
"stop_code",
models.CharField(
blank=True, max_length=255, verbose_name="Stop code"
),
),
(
"stop_name",
models.CharField(max_length=255, verbose_name="Stop name"),
),
(
"stop_desc",
models.CharField(
blank=True, max_length=255, verbose_name="Stop description"
),
),
("stop_lon", models.FloatField(verbose_name="Stop longitude")),
("stop_lat", models.FloatField(verbose_name="Stop latitude")),
("zone_id", models.CharField(max_length=255, verbose_name="Zone ID")),
("stop_url", models.URLField(blank=True, verbose_name="Stop URL")),
(
"location_type",
models.IntegerField(
blank=True,
choices=[
(0, "Stop/platform"),
(1, "Station"),
(2, "Entrance/exit"),
(3, "Generic node"),
(4, "Boarding area"),
],
default=0,
verbose_name="Location type",
),
),
(
"stop_timezone",
models.CharField(
blank=True, max_length=255, verbose_name="Stop timezone"
),
),
(
"level_id",
models.CharField(
blank=True, max_length=255, verbose_name="Level ID"
),
),
(
"wheelchair_boarding",
models.IntegerField(
blank=True,
choices=[
(0, "No information"),
(1, "Possible"),
(2, "Not possible"),
],
default=0,
verbose_name="Wheelchair boarding",
),
),
(
"platform_code",
models.CharField(max_length=255, verbose_name="Platform code"),
),
(
"parent_station",
models.ForeignKey(
blank=True,
on_delete=django.db.models.deletion.PROTECT,
to="sncfgtfs.stop",
verbose_name="Parent station",
),
),
],
options={
"verbose_name": "Stop",
"verbose_name_plural": "Stops",
},
),
migrations.CreateModel(
name="Transfer",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"transfer_type",
models.IntegerField(
choices=[
(0, "Recommended"),
(1, "Timed"),
(2, "Minimum time"),
(3, "Not possible"),
],
default=0,
verbose_name="Transfer type",
),
),
(
"min_transfer_time",
models.IntegerField(
blank=True, verbose_name="Minimum transfer time"
),
),
(
"from_stop",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="transfers_from",
to="sncfgtfs.stop",
verbose_name="From stop",
),
),
(
"to_stop",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="transfers_to",
to="sncfgtfs.stop",
verbose_name="To stop",
),
),
],
options={
"verbose_name": "Transfer",
"verbose_name_plural": "Transfers",
},
),
migrations.CreateModel(
name="Trip",
fields=[
(
"trip_id",
models.CharField(
max_length=255,
primary_key=True,
serialize=False,
verbose_name="Trip ID",
),
),
(
"service_id",
models.CharField(max_length=255, verbose_name="Service ID"),
),
(
"trip_headsign",
models.CharField(
blank=True, max_length=255, verbose_name="Trip headsign"
),
),
(
"trip_short_name",
models.CharField(
blank=True, max_length=255, verbose_name="Trip short name"
),
),
(
"direction_id",
models.IntegerField(
blank=True,
choices=[(0, "Outbound"), (1, "Inbound")],
verbose_name="Direction",
),
),
(
"block_id",
models.CharField(
blank=True, max_length=255, verbose_name="Block ID"
),
),
(
"shape_id",
models.CharField(
blank=True, max_length=255, verbose_name="Shape ID"
),
),
(
"wheelchair_accessible",
models.IntegerField(
blank=True,
choices=[
(0, "No information"),
(1, "Possible"),
(2, "Not possible"),
],
default=0,
verbose_name="Wheelchair accessible",
),
),
(
"bikes_allowed",
models.IntegerField(
choices=[
(0, "No information"),
(1, "Possible"),
(2, "Not possible"),
],
default=0,
verbose_name="Bikes allowed",
),
),
(
"route",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="sncfgtfs.route",
verbose_name="Route ID",
),
),
],
options={
"verbose_name": "Trip",
"verbose_name_plural": "Trips",
},
),
migrations.CreateModel(
name="StopTime",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("arrival_time", models.TimeField(verbose_name="Arrival time")),
("departure_time", models.TimeField(verbose_name="Departure time")),
("stop_sequence", models.IntegerField(verbose_name="Stop sequence")),
(
"stop_headsign",
models.CharField(
blank=True, max_length=255, verbose_name="Stop headsign"
),
),
(
"pickup_type",
models.IntegerField(
blank=True,
choices=[
(0, "Regular"),
(1, "None"),
(2, "Must phone agency"),
(3, "Must coordinate with driver"),
],
default=0,
verbose_name="Pickup type",
),
),
(
"drop_off_type",
models.IntegerField(
blank=True,
choices=[
(0, "Regular"),
(1, "None"),
(2, "Must phone agency"),
(3, "Must coordinate with driver"),
],
default=0,
verbose_name="Drop off type",
),
),
(
"timepoint",
models.BooleanField(
blank=True, default=True, verbose_name="Timepoint"
),
),
(
"stop",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="sncfgtfs.stop",
verbose_name="Stop ID",
),
),
(
"trip_id",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="sncfgtfs.trip",
verbose_name="Trip ID",
),
),
],
options={
"verbose_name": "Stop time",
"verbose_name_plural": "Stop times",
},
),
]