696 lines
25 KiB
Python
696 lines
25 KiB
Python
# Generated by Django 5.0.1 on 2024-02-10 16:30
|
|
|
|
import django.db.models.deletion
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
initial = True
|
|
|
|
dependencies = []
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name="Agency",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.CharField(
|
|
max_length=255,
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="Agency ID",
|
|
),
|
|
),
|
|
("name", models.CharField(max_length=255, verbose_name="Agency name")),
|
|
("url", models.URLField(verbose_name="Agency URL")),
|
|
(
|
|
"timezone",
|
|
models.CharField(max_length=255, verbose_name="Agency timezone"),
|
|
),
|
|
(
|
|
"lang",
|
|
models.CharField(
|
|
blank=True, max_length=255, verbose_name="Agency language"
|
|
),
|
|
),
|
|
(
|
|
"phone",
|
|
models.CharField(
|
|
blank=True, max_length=255, verbose_name="Agency phone"
|
|
),
|
|
),
|
|
(
|
|
"email",
|
|
models.EmailField(
|
|
blank=True, max_length=254, verbose_name="Agency email"
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "Agency",
|
|
"verbose_name_plural": "Agencies",
|
|
"ordering": ("name",),
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="Calendar",
|
|
fields=[
|
|
(
|
|
"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")),
|
|
(
|
|
"transport_type",
|
|
models.CharField(
|
|
choices=[
|
|
("TGV", "TGV"),
|
|
("TER", "TER"),
|
|
("IC", "Intercités"),
|
|
("TN", "Transilien"),
|
|
("ES", "Eurostar"),
|
|
("TI", "Trenitalia"),
|
|
("RENFE", "Renfe"),
|
|
("OBB", "ÖBB"),
|
|
],
|
|
max_length=255,
|
|
verbose_name="Transport type",
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "Calendar",
|
|
"verbose_name_plural": "Calendars",
|
|
"ordering": ("id",),
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="FeedInfo",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.BigAutoField(
|
|
auto_created=True,
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="ID",
|
|
),
|
|
),
|
|
(
|
|
"publisher_name",
|
|
models.CharField(
|
|
max_length=255, verbose_name="Feed publisher name"
|
|
),
|
|
),
|
|
("publisher_url", models.URLField(verbose_name="Feed publisher URL")),
|
|
(
|
|
"lang",
|
|
models.CharField(max_length=255, verbose_name="Feed language"),
|
|
),
|
|
("start_date", models.DateField(verbose_name="Feed start date")),
|
|
("end_date", models.DateField(verbose_name="Feed end date")),
|
|
(
|
|
"version",
|
|
models.CharField(max_length=255, verbose_name="Feed version"),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "Feed info",
|
|
"verbose_name_plural": "Feed infos",
|
|
"ordering": ("publisher_name",),
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="CalendarDate",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.CharField(
|
|
max_length=255,
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="ID",
|
|
),
|
|
),
|
|
("date", models.DateField(verbose_name="Date")),
|
|
(
|
|
"exception_type",
|
|
models.IntegerField(
|
|
choices=[(1, "Added"), (2, "Removed")],
|
|
verbose_name="Exception type",
|
|
),
|
|
),
|
|
(
|
|
"service",
|
|
models.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="dates",
|
|
to="sncfgtfs.calendar",
|
|
verbose_name="Service",
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "Calendar date",
|
|
"verbose_name_plural": "Calendar dates",
|
|
"ordering": ("id",),
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="Route",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.CharField(
|
|
max_length=255,
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="ID",
|
|
),
|
|
),
|
|
(
|
|
"short_name",
|
|
models.CharField(max_length=255, verbose_name="Route short name"),
|
|
),
|
|
(
|
|
"long_name",
|
|
models.CharField(max_length=255, verbose_name="Route long name"),
|
|
),
|
|
(
|
|
"desc",
|
|
models.CharField(
|
|
blank=True, max_length=255, verbose_name="Route description"
|
|
),
|
|
),
|
|
(
|
|
"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",
|
|
),
|
|
),
|
|
("url", models.URLField(blank=True, verbose_name="Route URL")),
|
|
(
|
|
"color",
|
|
models.CharField(
|
|
blank=True, max_length=255, verbose_name="Route color"
|
|
),
|
|
),
|
|
(
|
|
"text_color",
|
|
models.CharField(
|
|
blank=True, max_length=255, verbose_name="Route text color"
|
|
),
|
|
),
|
|
(
|
|
"transport_type",
|
|
models.CharField(
|
|
choices=[
|
|
("TGV", "TGV"),
|
|
("TER", "TER"),
|
|
("IC", "Intercités"),
|
|
("TN", "Transilien"),
|
|
("ES", "Eurostar"),
|
|
("TI", "Trenitalia"),
|
|
("RENFE", "Renfe"),
|
|
("OBB", "ÖBB"),
|
|
],
|
|
max_length=255,
|
|
verbose_name="Transport type",
|
|
),
|
|
),
|
|
(
|
|
"agency",
|
|
models.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="routes",
|
|
to="sncfgtfs.agency",
|
|
verbose_name="Agency",
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "Route",
|
|
"verbose_name_plural": "Routes",
|
|
"ordering": ("id",),
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="Stop",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.CharField(
|
|
max_length=255,
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="Stop ID",
|
|
),
|
|
),
|
|
(
|
|
"code",
|
|
models.CharField(
|
|
blank=True, max_length=255, verbose_name="Stop code"
|
|
),
|
|
),
|
|
("name", models.CharField(max_length=255, verbose_name="Stop name")),
|
|
(
|
|
"desc",
|
|
models.CharField(
|
|
blank=True, max_length=255, verbose_name="Stop description"
|
|
),
|
|
),
|
|
("lon", models.FloatField(verbose_name="Stop longitude")),
|
|
("lat", models.FloatField(verbose_name="Stop latitude")),
|
|
("zone_id", models.CharField(max_length=255, verbose_name="Zone ID")),
|
|
("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",
|
|
),
|
|
),
|
|
(
|
|
"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(
|
|
blank=True, max_length=255, verbose_name="Platform code"
|
|
),
|
|
),
|
|
(
|
|
"transport_type",
|
|
models.CharField(
|
|
choices=[
|
|
("TGV", "TGV"),
|
|
("TER", "TER"),
|
|
("IC", "Intercités"),
|
|
("TN", "Transilien"),
|
|
("ES", "Eurostar"),
|
|
("TI", "Trenitalia"),
|
|
("RENFE", "Renfe"),
|
|
("OBB", "ÖBB"),
|
|
],
|
|
max_length=255,
|
|
verbose_name="Transport type",
|
|
),
|
|
),
|
|
(
|
|
"parent_station",
|
|
models.ForeignKey(
|
|
blank=True,
|
|
null=True,
|
|
on_delete=django.db.models.deletion.PROTECT,
|
|
related_name="children",
|
|
to="sncfgtfs.stop",
|
|
verbose_name="Parent station",
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "Stop",
|
|
"verbose_name_plural": "Stops",
|
|
"ordering": ("id",),
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="Transfer",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.CharField(
|
|
max_length=255,
|
|
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",
|
|
"ordering": ("id",),
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="Trip",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.CharField(
|
|
max_length=255,
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="Trip ID",
|
|
),
|
|
),
|
|
(
|
|
"headsign",
|
|
models.CharField(
|
|
blank=True, max_length=255, verbose_name="Trip headsign"
|
|
),
|
|
),
|
|
(
|
|
"short_name",
|
|
models.CharField(
|
|
blank=True, max_length=255, verbose_name="Trip short name"
|
|
),
|
|
),
|
|
(
|
|
"direction_id",
|
|
models.IntegerField(
|
|
choices=[(0, "Outbound"), (1, "Inbound")],
|
|
null=True,
|
|
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(
|
|
choices=[
|
|
(0, "No information"),
|
|
(1, "Possible"),
|
|
(2, "Not possible"),
|
|
],
|
|
default=0,
|
|
null=True,
|
|
verbose_name="Wheelchair accessible",
|
|
),
|
|
),
|
|
(
|
|
"bikes_allowed",
|
|
models.IntegerField(
|
|
choices=[
|
|
(0, "No information"),
|
|
(1, "Possible"),
|
|
(2, "Not possible"),
|
|
],
|
|
default=0,
|
|
null=True,
|
|
verbose_name="Bikes allowed",
|
|
),
|
|
),
|
|
(
|
|
"last_update",
|
|
models.DateTimeField(null=True, verbose_name="Last update"),
|
|
),
|
|
(
|
|
"route",
|
|
models.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="trips",
|
|
to="sncfgtfs.route",
|
|
verbose_name="Route",
|
|
),
|
|
),
|
|
(
|
|
"service",
|
|
models.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="trips",
|
|
to="sncfgtfs.calendar",
|
|
verbose_name="Service",
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "Trip",
|
|
"verbose_name_plural": "Trips",
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="StopTime",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.CharField(
|
|
max_length=255,
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="ID",
|
|
),
|
|
),
|
|
("arrival_time", models.DurationField(verbose_name="Arrival time")),
|
|
("departure_time", models.DurationField(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(
|
|
choices=[
|
|
(0, "Regular"),
|
|
(1, "None"),
|
|
(2, "Must phone agency"),
|
|
(3, "Must coordinate with driver"),
|
|
],
|
|
default=0,
|
|
null=True,
|
|
verbose_name="Pickup type",
|
|
),
|
|
),
|
|
(
|
|
"drop_off_type",
|
|
models.IntegerField(
|
|
choices=[
|
|
(0, "Regular"),
|
|
(1, "None"),
|
|
(2, "Must phone agency"),
|
|
(3, "Must coordinate with driver"),
|
|
],
|
|
default=0,
|
|
null=True,
|
|
verbose_name="Drop off type",
|
|
),
|
|
),
|
|
(
|
|
"timepoint",
|
|
models.BooleanField(
|
|
default=True, null=True, verbose_name="Timepoint"
|
|
),
|
|
),
|
|
(
|
|
"stop",
|
|
models.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="stop_times",
|
|
to="sncfgtfs.stop",
|
|
verbose_name="Stop ID",
|
|
),
|
|
),
|
|
(
|
|
"trip",
|
|
models.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="stop_times",
|
|
to="sncfgtfs.trip",
|
|
verbose_name="Trip",
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "Stop time",
|
|
"verbose_name_plural": "Stop times",
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="TripUpdate",
|
|
fields=[
|
|
(
|
|
"trip",
|
|
models.OneToOneField(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
primary_key=True,
|
|
related_name="update",
|
|
serialize=False,
|
|
to="sncfgtfs.trip",
|
|
verbose_name="Trip",
|
|
),
|
|
),
|
|
("start_date", models.DateField(verbose_name="Start date")),
|
|
("start_time", models.TimeField(verbose_name="Start time")),
|
|
(
|
|
"schedule_relationship",
|
|
models.IntegerField(
|
|
choices=[
|
|
(0, "Scheduled"),
|
|
(1, "Added"),
|
|
(2, "Unscheduled"),
|
|
(3, "Canceled"),
|
|
(5, "Replacement"),
|
|
(6, "Duplicated"),
|
|
(7, "Deleted"),
|
|
],
|
|
default=0,
|
|
verbose_name="Schedule relationship",
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "Trip update",
|
|
"verbose_name_plural": "Trip updates",
|
|
"ordering": ("start_date", "trip"),
|
|
"unique_together": {("trip", "start_date", "start_time")},
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="StopTimeUpdate",
|
|
fields=[
|
|
(
|
|
"stop_time",
|
|
models.OneToOneField(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
primary_key=True,
|
|
related_name="update",
|
|
serialize=False,
|
|
to="sncfgtfs.stoptime",
|
|
verbose_name="Stop time",
|
|
),
|
|
),
|
|
("arrival_delay", models.DurationField(verbose_name="Arrival delay")),
|
|
("arrival_time", models.DateTimeField(verbose_name="Arrival time")),
|
|
(
|
|
"departure_delay",
|
|
models.DurationField(verbose_name="Departure delay"),
|
|
),
|
|
("departure_time", models.DateTimeField(verbose_name="Departure time")),
|
|
(
|
|
"schedule_relationship",
|
|
models.IntegerField(
|
|
choices=[
|
|
(0, "Scheduled"),
|
|
(1, "Skipped"),
|
|
(2, "No data"),
|
|
(3, "Unscheduled"),
|
|
],
|
|
default=0,
|
|
verbose_name="Schedule relationship",
|
|
),
|
|
),
|
|
(
|
|
"trip_update",
|
|
models.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="stop_time_updates",
|
|
to="sncfgtfs.tripupdate",
|
|
verbose_name="Trip update",
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "Stop time update",
|
|
"verbose_name_plural": "Stop time updates",
|
|
"ordering": ("trip_update", "stop_time"),
|
|
"unique_together": {("trip_update", "stop_time")},
|
|
},
|
|
),
|
|
]
|