577 lines
20 KiB
Python
577 lines
20 KiB
Python
# Generated by Django 5.0.1 on 2024-01-27 10:29
|
|
|
|
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, unique=True, 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",
|
|
},
|
|
),
|
|
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"),
|
|
],
|
|
max_length=255,
|
|
verbose_name="Transport type",
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "Calendar",
|
|
"verbose_name_plural": "Calendars",
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="FeedInfo",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.BigAutoField(
|
|
auto_created=True,
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="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.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",
|
|
),
|
|
),
|
|
(
|
|
"transport_type",
|
|
models.CharField(
|
|
choices=[
|
|
("TGV", "TGV"),
|
|
("TER", "TER"),
|
|
("IC", "Intercités"),
|
|
("TN", "Transilien"),
|
|
],
|
|
max_length=255,
|
|
verbose_name="Transport 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",
|
|
},
|
|
),
|
|
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"
|
|
),
|
|
),
|
|
(
|
|
"agency",
|
|
models.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="routes",
|
|
to="sncfgtfs.agency",
|
|
verbose_name="Agency ID",
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "Route",
|
|
"verbose_name_plural": "Routes",
|
|
},
|
|
),
|
|
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"
|
|
),
|
|
),
|
|
(
|
|
"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",
|
|
},
|
|
),
|
|
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",
|
|
},
|
|
),
|
|
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",
|
|
),
|
|
),
|
|
(
|
|
"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",
|
|
},
|
|
),
|
|
]
|